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 ); } } };
protected FastExportTemplateProducer createTemplateProducer() { return new FastHtmlTemplateProducer( getMetaData(), getSharedSheetLayout(), htmlPrinter ); } }
public FastHtmlExportProcessor( final MasterReport report, final FastHtmlContentItems contentItems ) throws ReportProcessingException { super( report, new HtmlDataOutputProcessor() ); this.contentItems = contentItems; }
public void initialize( final ReportDefinition report, final ExpressionRuntime runtime, final boolean pagination ) { super.initialize( report, runtime, pagination ); this.htmlPrinter = new FastHtmlPrinter( getSharedSheetLayout(), runtime.getProcessingContext().getResourceManager(), contentItems ); this.htmlPrinter.init( getMetaData(), report ); }
@Override protected void handleValueContent( final ReportElement element, final Object value, final boolean inlineSection ) throws ContentProcessingException { super.handleValueContent( element, value, inlineSection ); if ( value instanceof Shape ) { handleShape( element, (Shape) value ); } else if ( value instanceof ImageContainer || value instanceof DrawableWrapper || value instanceof RotatedTextDrawable ) { handleImage( element, value ); } else { handleText( element, String.valueOf( value ) ); } }
public void compute( final Band band, final ExpressionRuntime runtime, final OutputStream out ) throws ReportProcessingException, ContentProcessingException, IOException { elements.clear(); super.compute( band, runtime ); this.htmlPrinter.startSection( band ); this.htmlPrinter.print( runtime, gridLayout, elements, recordedBounds, styleCache ); this.htmlPrinter.endSection( band, gridLayout ); }
public void putCellAttributes( int row, int col, CellStyle attrs ) { cellAttributes.put( new CellKey( row, col ), attrs ); } }
private void recordInlineImageDimensions( final RenderBox content ) { recorder.process( content ); }
public FormattedDataBuilder createDataBuilder() { return new FastHtmlFormattedDataBuilder( gridLayout, htmlPrinter, recorder.getRecordedBounds() ); }
public FastHtmlFormattedDataBuilder( final FastGridLayout gridLayout, final FastHtmlPrinter htmlPrinter, final HashMap<InstanceID, FastHtmlImageBounds> recordedBounds ) { this.gridLayout = gridLayout; this.htmlPrinter = htmlPrinter; this.recordedBounds = recordedBounds; this.elements = new HashMap<InstanceID, ReportElement>(); this.styleCache = new FastHtmlStyleCache(); }
protected OutputFunction createLayoutManager() { return new FastExportOutputFunction( new FastHtmlExportTemplate( contentItems ) ); } }
public void initialize( final Configuration configuration ) { super.initialize( configuration ); addFeature( OutputProcessorFeature.FAST_EXPORT ); } };
public String rewriteContentDataItem( final ContentItem item ) throws URLRewriteException { return contentItems.getUrlRewriter().rewrite( documentContentItem, item ); }
public void close() throws IOException, ContentIOException { if ( writer != null ) { performCloseFile( sheetName, reportAttributes, writer ); try { writer.close(); } catch ( IOException e ) { // ignored .. logger.error( "Failed to close writer instance", e ); } } textExtractor = null; writer = null; documentContentItem = null; }
public void finishReport() throws ReportProcessingException { try { this.htmlPrinter.close(); } catch ( IOException e ) { throw new ReportProcessingException( "Failed to close report", e ); } catch ( ContentIOException e ) { throw new ReportProcessingException( "Failed to close report", e ); } }
public void init( final OutputProcessorMetaData metaData, final ReportDefinition report ) { this.metaData = metaData; this.reportAttributes = report.getAttributes(); initialize( metaData.getConfiguration() ); }
public FastHtmlTemplateProducer( final OutputProcessorMetaData metaData, final SheetLayout sheetLayout, final FastHtmlPrinter htmlPrinter ) { this.metaData = metaData; this.sheetLayout = sheetLayout; this.htmlPrinter = htmlPrinter; this.recorder = new Recorder(); this.cellBackgroundProducer = new CellBackgroundProducer( metaData .isFeatureSupported( AbstractTableOutputProcessor.TREAT_ELLIPSE_AS_RECTANGLE ), metaData .isFeatureSupported( OutputProcessorFeature.UNALIGNED_PAGEBANDS ) ); }
protected void handleShape( final ReportElement element, Shape image ) throws ContentProcessingException { boolean keepAr = element.getComputedStyle().getBooleanStyleProperty( ElementStyleKeys.KEEP_ASPECT_RATIO ); handleImage( element, new ShapeDrawable( image, keepAr ) ); }
protected void processOtherNode( final RenderNode node ) { if ( node instanceof RenderableComplexText ) { RenderableComplexText text = (RenderableComplexText) node; for ( RichTextSpec.StyledChunk c : text.getRichText().getStyleChunks() ) { if ( c.getOriginatingTextNode() instanceof RenderableReplacedContentBox ) { RenderBox box = (RenderBox) c.getOriginatingTextNode(); startBox( box ); } } } } }
public CellStyle getCellAttributes( int row, int col ) { return cellAttributes.get( new CellKey( row, col ) ); }