protected ReportProcessor createReportProcessor( OutputStream fout ) throws Exception { PdfOutputProcessor outputProcessor = new PdfOutputProcessor( report.getConfiguration(), fout, report.getResourceManager() ); return new PageableReportProcessor( report, outputProcessor ); } };
protected ReportProcessor createReportProcessor( OutputStream fout ) throws Exception { StreamRTFOutputProcessor target = new StreamRTFOutputProcessor( report.getConfiguration(), fout, report.getResourceManager() ); return new StreamReportProcessor( report, target ); } };
@Test public void testExportReportWithSupportedLocale() { when( masterReport.getConfiguration() ).thenReturn( mock( Configuration.class ) ); when( masterReport.getResourceManager() ).thenReturn( new ResourceManager() ); when( swingGuiContext.getLocale() ).thenReturn( Locale.US ); when( swingGuiContext.getStatusListener() ).thenReturn( mock( StatusListener.class ) ); Runnable exportTask = new ReportExportTask( masterReport, swingGuiContext, targetPath, createParentFolder ) { protected ReportProcessor createReportProcessor( OutputStream fout ) throws Exception { PdfOutputProcessor outputProcessor = new PdfOutputProcessor( masterReport.getConfiguration(), fout, masterReport.getResourceManager() ); return new PageableReportProcessor( masterReport, outputProcessor ); } }; assertNotNull( exportTask ); exportTask.run(); assertThat( swingGuiContext.getStatusType(), not( StatusType.ERROR ) ); }
@Test public void testExportReportWithUnsupportedLocale() { when( masterReport.getConfiguration() ).thenReturn( mock( Configuration.class ) ); when( masterReport.getResourceManager() ).thenReturn( new ResourceManager() ); when( swingGuiContext.getLocale() ).thenReturn( Locale.UK ); when( swingGuiContext.getStatusListener() ).thenReturn( mock( StatusListener.class ) ); Runnable exportTask = new ReportExportTask( masterReport, swingGuiContext, targetPath, createParentFolder ) { protected ReportProcessor createReportProcessor( OutputStream fout ) throws Exception { PdfOutputProcessor outputProcessor = new PdfOutputProcessor( masterReport.getConfiguration(), fout, masterReport.getResourceManager() ); return new PageableReportProcessor( masterReport, outputProcessor ); } }; assertNotNull( exportTask ); exportTask.run(); assertThat( swingGuiContext.getStatusType(), not( StatusType.ERROR ) ); } }
protected ReportProcessor createReportProcessor( OutputStream fout ) throws Exception { PdfOutputProcessor outputProcessor = new PdfOutputProcessor( masterReport.getConfiguration(), fout, masterReport.getResourceManager() ); return new PageableReportProcessor( masterReport, outputProcessor ); } };
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 ); } } };
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 { PdfOutputProcessor outputProcessor = new PdfOutputProcessor( masterReport.getConfiguration(), fout, masterReport.getResourceManager() ); return new PageableReportProcessor( masterReport, outputProcessor ); } };
protected ReportProcessor createReportProcessor( OutputStream fout ) throws Exception { final FlowHtmlOutputProcessor outputProcessor = new FlowHtmlOutputProcessor(); final HtmlPrinter printer = new AllItemsHtmlPrinter( report.getResourceManager() ); printer.setContentWriter( targetRoot, new DefaultNameGenerator( targetRoot, filename, suffix ) ); printer.setDataWriter( targetRoot, new DefaultNameGenerator( targetRoot, "content" ) ); printer.setUrlRewriter( new FileSystemURLRewriter() ); outputProcessor.setPrinter( printer ); return new FlowReportProcessor( report, outputProcessor ); } };
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 ResourceManager getResourceManager( final AbstractReportDefinition reportDefinition ) { ReportDefinition e = reportDefinition.getMasterReport(); if ( e instanceof MasterReport ) { final MasterReport report = (MasterReport) e; return report.getResourceManager(); } return new ResourceManager(); }
private void updateResourceBundleFactoryInternal() { if ( resourceBundleFactory instanceof ExtendedResourceBundleFactory ) { final ExtendedResourceBundleFactory erbf = (ExtendedResourceBundleFactory) resourceBundleFactory; erbf.setResourceLoader( getResourceManager(), getContentBase() ); } }
protected DataSchemaDefinition createDataSchemaDefinition( final MasterReport masterReportElement ) { DataSchemaDefinition dataSchemaDefinition = masterReportElement.getDataSchemaDefinition(); if ( dataSchemaDefinition == null ) { return DataSchemaUtility.parseDefaults( masterReportElement.getResourceManager() ); } return dataSchemaDefinition; }
private ResourceManager locateResourceManager() { final ReportDefinition report = getMasterReport(); if ( report instanceof MasterReport ) { MasterReport mr = (MasterReport) report; return mr.getResourceManager(); } return new ResourceManager(); }
public PrintReportProcessor( final MasterReport report ) throws ReportProcessingException { super( report, new GraphicsOutputProcessor( report.getConfiguration(), report.getResourceManager() ) ); setFullStreamingProcessor( false ); }
public static void createRTF( final MasterReport report, final OutputStream outputStream ) throws ReportProcessingException { if ( report == null ) { throw new NullPointerException(); } if ( outputStream == null ) { throw new NullPointerException(); } final StreamRTFOutputProcessor target = new StreamRTFOutputProcessor( report.getConfiguration(), outputStream, report.getResourceManager() ); final StreamReportProcessor proc = new StreamReportProcessor( report, target ); proc.processReport(); proc.close(); } }
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, 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 ); }
public DesignTimeDataFactoryContext( final MasterReport report ) { this( report.getConfiguration(), report.getResourceManager(), report.getContentBase(), MasterReport .computeAndInitResourceBundleFactory( report.getResourceBundleFactory(), report.getReportEnvironment() ), report.getDataFactory() ); }
public DefaultProcessingContext( final MasterReport report, final OutputProcessorMetaData metaData ) throws ReportProcessingException { this( metaData, report.getResourceBundleFactory(), report.getConfiguration(), report.getResourceManager(), report .getContentBase(), report.getBundle().getMetaData(), report.getReportEnvironment(), -1 ); final Integer comLev = report.getCompatibilityLevel(); if ( comLev != null ) { compatibilityLevel = comLev; } }