Specifying your own drawing rendering class
Specifying your own drawing rendering class
In paginated reports, you can use the handler property in the <panel /> tag to override the default class that renders drawings and title block elements within the report.
Example:
<panel handler=
"com.archibus.app.solution.common.report.docx.CustomDrawingPanelBuilder">.If you specify a handler for a drawing panel (
<panel type=”drawing”
>), your Java class must inherit from
com.archibus.ext.report.docx.drawinghighlight.DrawingPanelBuilder.
If you override the default
processDrawingHighlight()
method, you can insert highlighted drawing images into a specific text box within your document template, and you can update template macros with values extracted from the database.
@Override public void processDrawingHighlight (final int leftIndent, final String drawingName, final String drawingTitle, final HighlightedImageResult imageResult) throws ExceptionBase { processReport (imageResult, drawingTitle); }
If you override the default
method processLegend()
, you can insert your own format for the drawing legend into a specific text box within your document template.
@Override
public void processLegend (final PanelBuilderBase legendPBuilder, final Report report, final java.util.List<DataSourceParameter> parameters, final int leftIndent, final int level) throws ExceptionBase { final TablePanelBuilderBase 1Builder = (TablePanelBuilderBase) legendPBuilder; final com.aspose.words.Document doc = this.getReport().getDocument(); final int recordIndex = this.getDwgNames().size() - 1; final Body body = doc.getSections().get(recordIndex).getBody(); { final Shape legendShap = getTextBoxShape (body, >LEGENDTABLE"); final Table table = new Table (doc); legendShap.removeAllChildren(); legendShap.appendChild(table); lBuilder.setDocxTable (table, doc); lBuilder.build (report, parameters, leftIndent, level); } }
An example is in:
This view uses the Java class /schema/ab-products/solutions/common/src/main/com/archibus/app/solution/common/report/docx/ CustomDrawingPanelBuilder.java
This view uses this template file:
schema/ab-products/solutions/parts/pagereports/report-cadplan-imperial.doc