public void writeReport( final WriteableDocumentBundle bundle, final MasterReport report, final DocumentBundle globalBundle ) throws IOException, BundleWriterException { if ( bundle == null ) { throw new NullPointerException(); } if ( report == null ) { throw new NullPointerException(); } if ( globalBundle == null ) { throw new NullPointerException(); } final WriteableDocumentMetaData data = bundle.getWriteableDocumentMetaData(); data.setBundleType( ClassicEngineBoot.BUNDLE_TYPE ); final MasterReport clone = (MasterReport) report.derive(); final BundleWriterState state = new BundleWriterState( clone, globalBundle, this ); for ( int i = 0; i < masterWriter.length; i++ ) { final BundleWriterHandler handler = masterWriter[i]; handler.writeReport( bundle, state ); } }
this.report = report.derive( designtime ); ReportProcessorThreadHolder.setProcessor( this );
public void testDerive() throws CloneNotSupportedException { final MasterReport report = new MasterReport(); report.setQueryLimit( 10 ); report.setQueryTimeout( 10 ); final MasterReport element = (MasterReport) report.derive(); assertEquals( 10, element.getQueryLimit() ); assertEquals( 10, element.getQueryTimeout() ); }
public static LogicalPageBox layoutSingleBand( final MasterReport originalReport, final Band reportHeader, final FontStorage fontRegistry, final boolean expectPageBreak, final boolean designTime ) throws ReportProcessingException, ContentProcessingException { final ReportStateKey stateKey = new ReportStateKey(); final DebugOutputProcessorMetaData metaData = new DebugOutputProcessorMetaData( fontRegistry ); metaData.setDesignTime( designTime ); final MasterReport report = originalReport.derive( true ); resolveStyle( report ); resolveStyle( reportHeader ); metaData.initialize( wrapForCompatibility( report ) ); final ProcessingContext processingContext = new DefaultProcessingContext( report, metaData ); final DebugExpressionRuntime runtime = new DebugExpressionRuntime( new DefaultTableModel(), 0, processingContext ); final DebugRenderer debugLayoutSystem = new DebugRenderer( metaData ); debugLayoutSystem.setStateKey( stateKey ); debugLayoutSystem.startReport( report, processingContext, new DefaultPerformanceMonitorContext() ); debugLayoutSystem.startSection( Renderer.SectionType.NORMALFLOW ); debugLayoutSystem.add( reportHeader, runtime ); debugLayoutSystem.endSection(); if ( expectPageBreak ) { debugLayoutSystem.endReport(); final Renderer.LayoutResult result = debugLayoutSystem.validatePages(); Assert.assertEquals( Renderer.LayoutResult.LAYOUT_PAGEBREAK, result ); } else { debugLayoutSystem.validatePages(); } return debugLayoutSystem.getPageBox(); }