protected ReportProcessor createReportProcessor( OutputStream fout ) throws Exception { ReportStructureValidator validator = new ReportStructureValidator(); if ( validator.isValidForFastProcessing( report ) == false ) { StreamCSVOutputProcessor target = new StreamCSVOutputProcessor( fout ); return new StreamReportProcessor( report, target ); } else { return new FastCsvExportProcessor( report, fout ); } } };
public void compute( final AbstractReportDefinition report ) { inspect( report ); DynamicStyleRootBandAnalyzer rootBandAnalyzer = new DynamicStyleRootBandAnalyzer( styleByElementName, styleById ); for ( Section element : rootBands ) { rootBandAnalyzer.compute( element ); } }
protected void inspectExpression( final AbstractReportDefinition report, final Expression expression ) { if ( expression instanceof RowBandingFunction ) { handleRowBanding( report, (RowBandingFunction) expression ); } if ( expression instanceof ItemHideFunction ) { handleItemHide( (ItemHideFunction) expression ); } if ( expression instanceof ElementTrafficLightFunction ) { handleTrafficLightFunction( (ElementTrafficLightFunction) expression ); } }
public void compute( final Section rootLevelBand ) { this.dynamicTemplateInfo.clear(); inspectElement( rootLevelBand ); traverseSection( rootLevelBand ); HashMap<InstanceID, StyleKey[]> stash = buildStash(); rootLevelBand.setAttribute( AttributeNames.Internal.NAMESPACE, AttributeNames.Internal.FAST_EXPORT_DYNAMIC_STASH, stash ); }
public MasterReport performPreProcessing( final MasterReport definition, final DefaultFlowController flowController ) throws ReportProcessingException { OutputProcessorMetaData meta = flowController.getReportContext().getOutputProcessorMetaData(); if ( meta.isFeatureSupported( OutputProcessorFeature.FAST_EXPORT ) ) { DynamicReportStyleAnalyzer analyzer = new DynamicReportStyleAnalyzer(); analyzer.compute( definition ); } return definition; }
public boolean isValidForFastProcessing( MasterReport report ) { valid = true; inspect( report ); return valid; }
protected void traverseSection( final Section section ) { traverseSectionWithSubReports( section ); }
protected void traverseSection( final Section section ) { traverseSectionWithoutSubReports( section ); }
protected void traverseSection( final Section section ) { traverseSectionWithoutSubReports( section ); }
protected void inspectElement( final ReportElement element ) { dynamicTemplateInfo.add( element.getObjectID(), ElementStyleKeys.VISIBLE ); String name = element.getName(); if ( styleByElementName.containsKey( name ) ) { Iterator<StyleKey> it = styleByElementName.getAll( name ); while ( it.hasNext() ) { this.dynamicTemplateInfo.put( element.getObjectID(), it.next() ); } } traverseStyleExpressions( element ); }
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 SubReport performPreProcessing( final SubReport definition, final DefaultFlowController flowController ) throws ReportProcessingException { OutputProcessorMetaData meta = flowController.getReportContext().getOutputProcessorMetaData(); if ( meta.isFeatureSupported( OutputProcessorFeature.FAST_EXPORT ) ) { DynamicReportStyleAnalyzer analyzer = new DynamicReportStyleAnalyzer(); analyzer.compute( definition ); } return definition; } }
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 ); } } };
protected ReportProcessor createReportProcessor( OutputStream fout ) throws Exception { ReportStructureValidator validator = new ReportStructureValidator(); if ( validator.isValidForFastProcessing( report ) == false ) { final HtmlOutputProcessor outputProcessor = new StreamHtmlOutputProcessor( report.getConfiguration() ); final HtmlPrinter printer = new AllItemsHtmlPrinter( report.getResourceManager() ); printer.setContentWriter( targetRoot, new DefaultNameGenerator( targetRoot, filename, suffix ) ); printer.setDataWriter( null, null ); // $NON-NLS-1$ printer.setUrlRewriter( new FileSystemURLRewriter() ); outputProcessor.setPrinter( printer ); return new StreamReportProcessor( report, outputProcessor ); } else { FastHtmlContentItems printer = new FastHtmlContentItems(); printer.setContentWriter( targetRoot, new DefaultNameGenerator( targetRoot, filename, suffix ) ); printer.setDataWriter( null, null ); // $NON-NLS-1$ printer.setUrlRewriter( new FileSystemURLRewriter() ); return new FastHtmlExportProcessor( report, printer ); } } };
public static void process( MasterReport report, OutputStream out ) throws ReportProcessingException, IOException { ReportStructureValidator validator = new ReportStructureValidator(); if ( validator.isValidForFastProcessing( report ) == false ) { CSVReportUtil.createCSV( report, out, null ); return; } final FastCsvExportProcessor reportProcessor = new FastCsvExportProcessor( report, out ); reportProcessor.processReport(); reportProcessor.close(); out.flush(); }
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(); }
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(); }
@Test public void testShallowInlineSubReportDetection() { SubReport srInner = new SubReport(); SubReport sr = new SubReport(); sr.getReportHeader().addElement( srInner ); MasterReport report = new MasterReport(); report.getReportHeader().addElement( sr ); ReportStructureValidator v = new ReportStructureValidator(); Assert.assertFalse( v.isValidForFastProcessing( report ) ); }
@Test public void testDeepInlineSubReportDetection() { SubReport srInner = new SubReport(); SubReport sr = new SubReport(); sr.getReportHeader().addElement( srInner ); MasterReport report = new MasterReport(); report.getReportHeader().addSubReport( sr ); ReportStructureValidator v = new ReportStructureValidator(); Assert.assertFalse( v.isValidForFastProcessing( report ) ); }
@Test public void testNoneInlineSubReportDetection() { SubReport srInner = new SubReport(); SubReport sr = new SubReport(); sr.getReportHeader().addSubReport( srInner ); MasterReport report = new MasterReport(); report.getReportHeader().addSubReport( sr ); ReportStructureValidator v = new ReportStructureValidator(); Assert.assertTrue( v.isValidForFastProcessing( report ) ); }