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 { 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 { 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( 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 { 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 ); } } };
/** * Creates a new XMLProcessor. The processor will output the report as simple xml stream. * * @param report * the report that should be processed * @throws ReportProcessingException * if the report could not be initialized */ public XMLProcessor( final MasterReport report ) throws ReportProcessingException { super( report, new XMLDataOutputProcessor( report.getConfiguration() ) ); }
protected HtmlOutputProcessor createOutputProcessor() { if ( "pageable".equals( exportMethod ) ) { //$NON-NLS-1$ return new PageableHtmlOutputProcessor( report.getConfiguration() ); } else if ( "flow".equals( exportMethod ) ) { //$NON-NLS-1$ return new FlowHtmlOutputProcessor(); } else { return new StreamHtmlOutputProcessor( report.getConfiguration() ); } } }
protected HtmlOutputProcessor createOutputProcessor() { if ( "pageable".equals( exportMethod ) ) { //$NON-NLS-1$ return new PageableHtmlOutputProcessor( report.getConfiguration() ); } else if ( "flow".equals( exportMethod ) ) { //$NON-NLS-1$ return new FlowHtmlOutputProcessor(); } else { return new StreamHtmlOutputProcessor( report.getConfiguration() ); } }
public String getReportMimeType() { final MasterReport masterReport = getReport(); final Configuration configuration = masterReport.getConfiguration(); return computeMimeType( configuration ); } }
public Configuration getConfiguration() { final MasterReport report = getReportJob(); if ( report != null ) { return report.getConfiguration(); } return ClassicEngineBoot.getInstance().getGlobalConfig(); }
protected Configuration computeContextConfiguration() { final MasterReport report = getReportJob(); if ( report != null ) { return report.getConfiguration(); } return ClassicEngineBoot.getInstance().getGlobalConfig(); } }
public static void createPlainText( final MasterReport report, final String filename ) throws IOException, ReportProcessingException { final Configuration configuration = report.getConfiguration(); final String cpiText = configuration .getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.plaintext.CharsPerInch" ); final String lpiText = configuration .getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.plaintext.LinesPerInch" ); createPlainText( report, filename, ParserUtil.parseInt( cpiText, 10 ), ParserUtil.parseInt( lpiText, 6 ) ); }
public static void createPlainText( final MasterReport report, final OutputStream outputStream ) throws ReportProcessingException { final Configuration configuration = report.getConfiguration(); final String cpiText = configuration .getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.plaintext.CharsPerInch" ); final String lpiText = configuration .getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.plaintext.LinesPerInch" ); createPlainText( report, outputStream, ParserUtil.parseInt( cpiText, 10 ), ParserUtil.parseInt( lpiText, 6 ), null ); }
public static void createTextFile( final MasterReport report, final String filename ) throws IOException, ReportProcessingException { final Configuration configuration = report.getConfiguration(); final String cpiText = configuration .getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.plaintext.CharsPerInch" ); final String lpiText = configuration .getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.plaintext.LinesPerInch" ); createTextFile( report, filename, ParserUtil.parseInt( cpiText, 10 ), ParserUtil.parseInt( lpiText, 6 ) ); }
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; } }