protected ReportProcessor createReportProcessor( OutputStream fout ) throws Exception { ReportStructureValidator validator = new ReportStructureValidator(); if ( validator.isValidForFastProcessing( report ) == false ) { final FlowExcelOutputProcessor target = new FlowExcelOutputProcessor( report.getConfiguration(), fout, report.getResourceManager() ); target.setUseXlsxFormat( false ); return new FlowReportProcessor( report, target ); } else { return new FastExcelExportProcessor( report, fout, false ); } } };
public void render() throws Exception { createReport(); ClassLoader originalClassloader = Thread.currentThread().getContextClassLoader(); try { // we need to change the current classloader for the reporting to find our plugin classes Thread.currentThread().setContextClassLoader( KettleReportBuilder.class.getClassLoader() ); switch ( options.getOutputType() ) { case PDF: PdfReportUtil.createPDF( report, targetFilename ); break; case DOC: RTFReportUtil.createRTF( report, targetFilename ); break; case XLS: ExcelReportUtil.createXLS( report, targetFilename ); break; case HTML: HtmlReportUtil.createDirectoryHTML( report, targetFilename ); break; case CSV: CSVReportUtil.createCSV( report, targetFilename ); break; default: break; } } finally { Thread.currentThread().setContextClassLoader( originalClassloader ); } }
/** * DefaultConstructor. Loads the module specification. * * @throws ModuleInitializeException * if an error occured. */ public ExcelTableModule() throws ModuleInitializeException { loadModuleInfo(); }
public static void createXLS( final MasterReport report, final OutputStream outputStream, final ReportProgressListener listener ) throws ReportProcessingException { if ( report == null ) { throw new NullPointerException(); } if ( outputStream == null ) { throw new NullPointerException(); } final FlowExcelOutputProcessor target = new FlowExcelOutputProcessor( report.getConfiguration(), outputStream, report.getResourceManager() ); target.setUseXlsxFormat( false ); final FlowReportProcessor reportProcessor = new FlowReportProcessor( report, target ); if ( listener != null ) { reportProcessor.addReportProgressListener( listener ); } doProcess( listener, reportProcessor ); }
protected void processingContentFinished() { if ( isContentGeneratable() == false ) { return; } if ( !this.printer.isInitialized() ) { this.printer.init( metaData ); } this.metaData.commit(); printer.close(); }
protected void processingContentFinished() { if ( isContentGeneratable() == false ) { return; } if ( !this.printer.isInitialized() ) { this.printer.init( metaData ); } this.metaData.commit(); this.printer.close(); }
protected void processingContentFinished() { if ( isContentGeneratable() == false ) { return; } if ( !this.printer.isInitialized() ) { this.printer.init( metaData ); } this.metaData.commit(); this.printer.close(); }
public static void createXLSX( final MasterReport report, final OutputStream outputStream ) throws ReportProcessingException { createXLSX( report, outputStream, null ); }
protected TableContentProducer createTableContentProducer( final SheetLayout layout ) { return new ExcelTableContentProducer( layout, getMetaData() ); } }
protected TableContentProducer createTableContentProducer( final SheetLayout layout ) { return new ExcelTableContentProducer( layout, getMetaData() ); } }
protected TableContentProducer createTableContentProducer( final SheetLayout layout ) { return new ExcelTableContentProducer( layout, getMetaData() ); } }
public PhysicalPageKey getPhysicalPage( final int page ) { if ( isPaginationFinished() == false ) { throw new IllegalStateException(); } return (PhysicalPageKey) physicalPages.get( page ); }
/** * Saves a report to Excel format. * * @param report the report. * @param filename target file name. * @throws ReportProcessingException if the report processing failed. * @throws IOException if there was an IOerror while processing the report. */ public static void createXLS( final MasterReport report, final String filename ) throws IOException, ReportProcessingException { if ( report == null ) { throw new NullPointerException(); } if ( filename == null ) { throw new NullPointerException(); } OutputStream fout = new BufferedOutputStream( new FileOutputStream( filename ) ); processFlowXls( report, fout ); }
/** * Saves a report to Excel format. * * @param report the report. * @param filename target file name. * @throws ReportProcessingException if the report processing failed. * @throws IOException if there was an IOerror while processing the report. */ public static void createXLSX( final MasterReport report, final String filename ) throws IOException, ReportProcessingException { if ( report == null ) { throw new NullPointerException(); } if ( filename == null ) { throw new NullPointerException(); } OutputStream fout = new BufferedOutputStream( new FileOutputStream( filename ) ); processFlowXlsx( report, fout ); }
public static void createXLSX( final MasterReport report, final OutputStream outputStream, final ReportProgressListener listener ) throws ReportProcessingException { if ( report == null ) { throw new NullPointerException(); } if ( outputStream == null ) { throw new NullPointerException(); } final FlowExcelOutputProcessor target = new FlowExcelOutputProcessor( report.getConfiguration(), outputStream, report.getResourceManager() ); target.setUseXlsxFormat( true ); final FlowReportProcessor reportProcessor = new FlowReportProcessor( report, target ); if ( listener != null ) { reportProcessor.addReportProgressListener( listener ); } doProcess( listener, reportProcessor ); }
public static void createXLS( final MasterReport report, final OutputStream outputStream ) throws ReportProcessingException { createXLS( report, outputStream, null ); }
protected ReportProcessor createReportProcessor( OutputStream fout ) throws Exception { ReportStructureValidator validator = new ReportStructureValidator(); if ( validator.isValidForFastProcessing( report ) == false ) { final FlowExcelOutputProcessor target = new FlowExcelOutputProcessor( report.getConfiguration(), fout, report.getResourceManager() ); target.setUseXlsxFormat( true ); return new FlowReportProcessor( report, target ); } else { return new FastExcelExportProcessor( report, fout, true ); } } };
public static void processXlsx( final MasterReport report, final OutputStream out, final ReportProgressListener listener ) throws ReportProcessingException, IOException { ReportStructureValidator validator = new ReportStructureValidator(); if ( validator.isValidForFastProcessing( report ) == false ) { ExcelReportUtil.createXLSX( report, out, listener ); return; } final FastExcelExportProcessor reportProcessor = new FastExcelExportProcessor( report, out, true ); if ( listener != null ) { reportProcessor.addReportProgressListener( listener ); } doProcess( listener, reportProcessor ); out.flush(); }
public static void createXLS( final MasterReport report ) throws Exception { try { ExcelReportUtil.createXLS( report, new NullOutputStream() ); } catch ( ReportParameterValidationException e ) { Assert.fail(); } }
public static void processXls( final MasterReport report, final OutputStream out, final ReportProgressListener listener ) throws ReportProcessingException, IOException { ReportStructureValidator validator = new ReportStructureValidator(); if ( validator.isValidForFastProcessing( report ) == false ) { ExcelReportUtil.createXLS( report, out, listener ); return; } final FastExcelExportProcessor reportProcessor = new FastExcelExportProcessor( report, out, false ); if ( listener != null ) { reportProcessor.addReportProgressListener( listener ); } doProcess( listener, reportProcessor ); out.flush(); }