Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Avoid automatic column binding in when creating charts
mariaux
<p>Hi,</p><p> </p><p>I am having a little problem creating a chart with the DE API. I'm trying to create a chart on the footer of a table group that is supposed to display the information shown in that particular group.</p><p> </p><p>The chart is placed in a ExtendedItemHandle and the x and y axis are created using the following piece of code:</p><p> </p><div><strong>Query xQuery = QueryImpl.create("row["Offset"]");</strong></div><div>Series seCategory = SeriesImpl.create();</div><div>seCategory.getDataDefinition().add(xQuery);</div><div>SeriesDefinition sdX = SeriesDefinitionImpl.create();</div><div>sdX.getSeries().add(seCategory);</div><div>xAxis.getSeriesDefinitions().add(sdX);</div><div> </div><div>I don't bind this container to any particular data set since I want the expressions <strong>row["XXXXX"] </strong>to be directly linked to the <strong>table column bindings. </strong>The column bindings in the table are mathematical transformations that I don't want to override. </div><p> </p><p>However when I render the report, the chart shows the values before the transformations. And when I inspected the XML in .rptdesign file I found the following lines have been added automatically within the extended item container:</p><p> </p><div> </div><div> <property name="inheritColumns">true</property></div><div> <property name="height">200pt</property></div><div> <property name="width">400pt</property></div><div> <list-property name="boundDataColumns"></div><div> <structure></div><div> <property name="name">Offset</property></div><div> <expression name="expression">dataSetRow["Offset"]</expression></div><div> </structure></div><div> <structure></div><div> <property name="name">RadialDisp</property></div><div> <expression name="expression">dataSetRow["RadialDisp"]</expression></div><div> </structure></div><div> </list-property></div><div> </extended-item></div><div> </div><div>This means that<strong> additional column bindings were created automatically for the container</strong>, overriding my transformations. How can I stop this from occurring? How can I <strong>explicitly specify that I want the chart to inherit the columns from the table?</strong> I have already made sure that its not me who is creating this additional bindings. Also when I erase these lines the charts show the information I was expecting. </div><div> </div><div>Thanks in advance!</div><div> </div><div>Maria </div>
Find more posts tagged with
Comments
mwilliams
<p>Have you tried grabbing the boundDataColumns property and clearing it when you create your chart so that it grabs the bindings from the outer table? I've not tried this, just seems like it'd work. Let me know.</p>
mariaux
<p>Hi mwilliams, thanks for you reply!</p><p> </p><p>I just tried doing the following and it didn't work:</p><p> </p><div style="margin-left:40px;">Iterator columnBind = container.getColumnBindings().iterator();</div><div style="margin-left:40px;">ComputedColumn c;</div><div style="margin-left:40px;">while((c = (ComputedColumn) columnBind.next()) != null) {</div><div style="margin-left:80px;">System.out.println(c.getName());</div><div style="margin-left:40px;">}</div><div style="margin-left:40px;"> </div><div style="margin-left:40px;">container.getPropertyHandle("boundDataColumns").clearValue();</div><div style="margin-left:40px;"> </div><div>The print statement was never executed and the additional bindings were there when examining the XML. I also tried to render the report before invoking the function ReportDesignHandle.saveAs and I'm obtaining the result I'm expecting (without the bindings). So my understanding of all this is that the additional bindings are created by the function <strong>saveAs</strong>. Why is this happening?</div><div> </div><div><strong>In my case I need to save the report in a .rptdesign file because this template is going to be rendered by another application later. </strong></div><div> </div><div>Also I have discovered that additional bindings are created when I invoke the function row["XXXXXX"] in an expression within a table group. For example in the following code it try to filter a table group so it displays only the group that contains the maximum value:</div><div> </div><div> </div><div><div>TableHandle table = getTableHandle(); </div><div>TableGroupHandle group = (TableGroupHandle) table.getGroups().get(groupIndex);</div><div> </div><div>// Create an aggregation to determine the maximum per group</div><div><div>ComputedColumn c = StructureFactory.createComputedColumn();</div><div>c.setAggregateOn(group.getName());</div><div>c.setAggregateFunction(DesignChoiceConstants.AGGREGATION_FUNCTION_MAX);</div><div>c.setName("groupCond_radialDisp");</div><div>c.setExpression(row["radialDisp"]); // This field does exist as a previous binding to a dataset column,</div></div><div>table.getColumnBindings().addItem(c);</div><div> </div><div>PropertyHandle filterProp = (PropertyHandle) group</div><div>.getPropertyHandle(TableGroupHandle.FILTER_PROP);</div><div> </div><div>// Create the filter condition</div><div><div>FilterCondition filter = StructureFactory.createFilterCond();</div><div>filter.setOperator(DesignChoiceConstants.FILTER_OPERATOR_TOP_N);</div><div>filter.setValue1("1");</div><div>filter.setExpr(row["groupCond_radialDisp"]);<span> </span></div></div><div>filterProp.addItem(filter);</div><div> </div><div>Again, by doing this an additional binding is created after invoking the function saveAs. The binding is groupCond_radialDisp_1 -> dataSetRow["groupCond_radialDisp"]. Obviously the groupCond_radialDisp doesn't exist in the dataset and the rendering produces an error. What am I missing here? Why are the additional bindings being created?</div><div> </div><div> </div><div> </div><div> </div></div>
mwilliams
<p>I've never heard of anyone having this issue before. Can you set up a simple example that I can run where I'll see this issue?</p><p> </p><p>Also, what is your BIRT version? If using an older version, have you tried this with a newer version?</p>
mariaux
<p>Dear mwilliams,</p><p> </p><p>Thank you very much for your reply. I think is person is having the same problem as me: <a data-ipb='nomediaparse' href='
http://www.birt-exchange.org/forum/index.php?/topic/28597-api-automatically-creates-broken-binding/?hl=binding'>http://www.birt-exchange.org/forum/index.php?/topic/28597-api-automatically-creates-broken-binding/?hl=binding</a></p><p> </p><p>I'm
using BIRT runtime 4.2.2 (specifically org.eclipse.birt.runtime_4.2.2.v20130216-1152.jar). I have access to the DE API source code which is the very latest, but I am not sure how to generate a new runtime (If you could point out how to do this I will greatly appreciate it).</p><p> </p><p>I will generate a short example of the error shortly. </p><p> </p><p>Many thanks,</p><p> </p><p>Maria </p>
mariaux
<p>Hi mwilliams,
Here you have a simple example where the error occurs. Please fix the paths in ReportGenerator.java for the location of the engine and the XML file.
Note between lines 258 and 270 a group filter is added on a group aggregation. Then the script renders the report twice with no problem in pdf and html format. After invoking the function saveAs the report gets corrupted and the rendering is not possible.
If you open the .rptdesign file with Eclipse you will see the problem is an additional binding to a non-existent database field.</p><p> </p><p>Many thanks,
Here is the full script:</p><div><pre class="_prettyXprint">import java.io.ByteArrayOutputStream;import java.io.IOException;import java.util.logging.Level;import java.util.logging.Logger;import org.eclipse.birt.core.data.DataType;import org.eclipse.birt.core.framework.Platform;import org.eclipse.birt.report.engine.api.EngineConfig;import org.eclipse.birt.report.engine.api.EngineException;import org.eclipse.birt.report.engine.api.IReportEngine;import org.eclipse.birt.report.engine.api.IReportEngineFactory;import org.eclipse.birt.report.engine.api.IReportRunnable;import org.eclipse.birt.report.engine.api.IRunAndRenderTask;import org.eclipse.birt.report.engine.api.RenderOption;import org.eclipse.birt.report.model.api.CellHandle;import org.eclipse.birt.report.model.api.DataItemHandle;import org.eclipse.birt.report.model.api.DataSetHandle;import org.eclipse.birt.report.model.api.DesignConfig;import org.eclipse.birt.report.model.api.DesignEngine;import org.eclipse.birt.report.model.api.ElementFactory;import org.eclipse.birt.report.model.api.LabelHandle;import org.eclipse.birt.report.model.api.OdaDataSetHandle;import org.eclipse.birt.report.model.api.OdaDataSourceHandle;import org.eclipse.birt.report.model.api.PropertyHandle;import org.eclipse.birt.report.model.api.ReportDesignHandle;import org.eclipse.birt.report.model.api.ReportItemHandle;import org.eclipse.birt.report.model.api.RowHandle;import org.eclipse.birt.report.model.api.ScalarParameterHandle;import org.eclipse.birt.report.model.api.SessionHandle;import org.eclipse.birt.report.model.api.StructureFactory;import org.eclipse.birt.report.model.api.StyleHandle;import org.eclipse.birt.report.model.api.TableGroupHandle;import org.eclipse.birt.report.model.api.TableHandle;import org.eclipse.birt.report.model.api.activity.SemanticException;import org.eclipse.birt.report.model.api.command.ContentException;import org.eclipse.birt.report.model.api.command.NameException;import org.eclipse.birt.report.model.api.command.StyleException;import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants;import org.eclipse.birt.report.model.api.elements.structures.ComputedColumn;import org.eclipse.birt.report.model.api.elements.structures.FilterCondition;import org.eclipse.birt.report.model.elements.Cell;import org.eclipse.birt.report.model.elements.TableRow;import com.ibm.icu.util.ULocale;/** *
@author
maria.franco *
@since
28 Jun 2013 * */public class ReportGenerator {static DesignConfig designConfig;static EngineConfig engineConfig;static DesignEngine engine;static ReportDesignHandle design;static ElementFactory efactory;private static void generateReport() throws SemanticException, IOException,EngineException {Logger log = Logger.getLogger("py4j");log.setLevel(Level.FINEST);// Setting up the design and engine configurations for design and// rendering.designConfig = new DesignConfig();designConfig.setProperty("BIRT_HOME","C:Program Filesbirt-runtime-4_2_2ReportEngine");engineConfig = new EngineConfig();engineConfig.setProperty("BIRT_HOME","C:Program Filesbirt-runtime-4_2_2ReportEngine");engineConfig.setLogConfig("C:temp", Level.FINE);// Initialising the Platform objectsengine = new DesignEngine(designConfig);SessionHandle session = engine.newSessionHandle(ULocale.ENGLISH);// Create a new report design.design = session.createDesign();efactory = design.getElementFactory();// Create the data source and data setscreateXMLDataSource("D:devHothsourcepocWrongBindingsrcexample.xml");initialiseDatasets();createStyles();// Create the tablecreateTable();renderToFile("c:temptestswrongBinding1.pdf", "pdf");renderToFile("c:temptestswrongBinding1.html", "html");// Save the reportdesign.saveAs("c:temptestswrongBinding.rptdesign");renderToFile("c:temptestswrongBinding2.pdf", "pdf");renderToFile("c:temptestswrongBinding2.html", "html");}private static OdaDataSourceHandle createXMLDataSource(String xmlFilePath)throws SemanticException {OdaDataSourceHandle element = efactory.newOdaDataSource("Data source","org.eclipse.datatools.enablement.oda.xml");ScalarParameterHandle param = efactory.newScalarParameter("reportxml");param.setDefaultValue(xmlFilePath);param.setHidden(true);param.setDisplayName("Report XML File");param.setDataType(DataType.STRING_TYPE_NAME);design.getParameters().add(param);design.getDataSources().add(element);element.setPropertyBinding("FILELIST", "params["reportxml"].value");return element;}private static void initialiseDatasets() throws SemanticException {OdaDataSetHandle dataset = createDataset("Data source","Bearing PF Data Set","/SSDDesign/DutyCycles/Element/LoadCases/Element/ShadowComponents/Element[
@xsi
:type='SSDBearingPF']","{BearingName;STRING;/
@PartName}
,{LoadCaseName;STRING;../../Name},{RequiredLifeTime;STRING;../../RequiredLifeTime},{IsoDamage;STRING;/StaticCaseResults/IsoDamage},{IsoLifeSec;STRING;/StaticCaseResults/IsoLifeSec},{MagMisalignmentNormalToLoad;STRING;/StaticCaseResults/MagMisalignmentNormalToLoad},{RomaxDamage;STRING;/StaticCaseResults/RomaxDamage},{RomaxLifeSec;STRING;/StaticCaseResults/RomaxLifeSec},{IsoEquivalentLoad;STRING;/StaticCaseResults/IsoEquivalentLoad}");design.getDataSets().add(dataset);}private static OdaDataSetHandle createDataset(String dataSource,String dataSetName, String rowXPath, String colXPath)throws SemanticException {OdaDataSetHandle dsHandle = efactory.newOdaDataSet(dataSetName,"org.eclipse.datatools.enablement.oda.xml.dataSet");dsHandle.setDataSource(dataSource);dsHandle.setQueryText("table0#-TNAME-#table0#:#[" + rowXPath + "]#:#"+ colXPath);dsHandle.setPrivateDriverProperty("XML_FILE", "");dsHandle.setPrivateDriverProperty("MAX_ROW", "-1");return dsHandle;}private static byte[] htmlPreview() throws EngineException {IRunAndRenderTask runTask = getRunnableTask();final RenderOption OPTIONS = new RenderOption();ByteArrayOutputStream stream = new ByteArrayOutputStream();OPTIONS.setOutputStream(stream);OPTIONS.setOutputFormat("html");runTask.setRenderOption(OPTIONS);runTask.run();runTask.close();return stream.toByteArray();}private static void createTable() throws SemanticException {int numFields = 3;// Create tableTableHandle table = efactory.newTableItem("Table1", numFields, 2, 1, 2);// Set table headerRowHandle headerRow = (RowHandle) table.getHeader().get(0);CellHandle cell = (CellHandle) headerRow.getCells().get(0);setCellFullSpan(headerRow, cell, numFields);LabelHandle tableTitleLabel = efactory.newLabel("title_Table1");tableTitleLabel.setText("Bearing Table");tableTitleLabel.setStyleName("titleStyle");cell.getContent().add(tableTitleLabel);RowHandle footerRow = (RowHandle) table.getFooter().get(1);cell = (CellHandle) footerRow.getCells().get(0);setCellFullSpan(footerRow, cell, numFields);// Set table bindingtable.setDataSet((DataSetHandle) design.getDataSets().get(0));addColumnBinding(table, "BearingName", "dataSetRow["BearingName"]", "string");addColumnBinding(table, "LoadCaseName", "dataSetRow["LoadCaseName"]", "string");addColumnBinding(table, "IsoDamage", "dataSetRow["IsoDamage"]", "float"); addColumnBinding(table, "RomaxDamage", "dataSetRow["RomaxDamage"]", "float");// Set table headersRowHandle headerRow2 = (RowHandle) table.getHeader().get(1);addHeader("Load Case Name", headerRow2, 0);addHeader("ISO Damage", headerRow2, 1);addHeader("Romax Damage", headerRow2, 2);//Add the table groupaddTableGroup(table,numFields);//Add table detail RowHandle tableDetail = (RowHandle) table.getDetail().get(0);addContent("LoadCaseName", tableDetail, 0);addContent("IsoDamage", tableDetail, 1);addContent("RomaxDamage", tableDetail, 2);design.getBody().add(table);}private static void addTableGroup(TableHandle table, int colSpan)throws NameException, ContentException, SemanticException,StyleException {TableGroupHandle tableGroup = efactory.newTableGroup();tableGroup.setName("group_BearingName");table.getGroups().add(tableGroup);tableGroup.setKeyExpr("row["BearingName"]");
@SuppressWarnings("
;deprecation")RowHandle groupHeader = new RowHandle(design.getDesign(),new TableRow());tableGroup.getHeader().add(groupHeader);groupHeader.setStyleName("groupStyle");// Setting the content of the group rowCell cell = new Cell();
@SuppressWarnings("
;deprecation")CellHandle cellGroupHeader = new CellHandle(design.getDesign(), cell);DataItemHandle data = efactory.newDataItem("dataGroup_BearingName");data.setResultSetColumn("BearingName");cellGroupHeader.getContent().add(data);// One cell ocupies all the spacecell.setProperty("colSpan", colSpan);groupHeader.getCells().add(cellGroupHeader);// Add filterPropertyHandle filterProp = (PropertyHandle) tableGroup.getPropertyHandle(TableGroupHandle.FILTER_PROP);//Construct the group aggregation for the filterComputedColumn c = StructureFactory.createComputedColumn();c.setAggregateOn(tableGroup.getName()); c.setAggregateFunction(DesignChoiceConstants.AGGREGATION_FUNCTION_MAX);c.setName("groupMax");c.setExpression("row["IsoDamage"]");c.setDataType("float");table.getColumnBindings().addItem(c);// Create filter based on the maximumFilterCondition filter = StructureFactory.createFilterCond();filter.setOperator(DesignChoiceConstants.FILTER_OPERATOR_TOP_N);filter.setValue1("1");filter.setExpr("row["groupMax"]"); filterProp.addItem(filter);}private static void addHeader(String header, RowHandle headerRow2, int index)throws SemanticException, ContentException, NameException,StyleException {CellHandle headerCell = (CellHandle) headerRow2.getCells().get(index);LabelHandle label = efactory.newLabel("header_"+header);label.setText(header);headerCell.getContent().add(label);headerCell.setStyleName("headerStyle");}private static void addContent(String bindingName, RowHandle row, int index)throws SemanticException, StyleException, ContentException,NameException {DataItemHandle data = efactory.newDataItem("data_"+bindingName);data.setResultSetColumn(bindingName);CellHandle cell = (CellHandle) row.getCells().get(index);cell.setStyleName("contentStyle");cell.getContent().add(data);}private static void addColumnBinding(ReportItemHandle item, String bindingName,String bindingExpression, String type) throws SemanticException {ComputedColumn c = StructureFactory.createComputedColumn();c.setName(bindingName);c.setExpression(bindingExpression);c.setDataType(type);item.addColumnBinding(c, true);}private static void setCellFullSpan(RowHandle footerRow, CellHandle cell,int numFields) throws SemanticException {int slotlength = footerRow.getCells().getCount();for (int i = 1; i < slotlength; i++) {footerRow.getCells().drop(1);}// Setting the table footer to 1 long columncell.setProperty("colSpan", numFields);}private static void createStyles() throws SemanticException {StyleHandle titleStyle = efactory.newStyle("titleStyle");titleStyle.setProperty(StyleHandle.FONT_FAMILY_PROP, "Tahoma");titleStyle.setProperty(StyleHandle.FONT_SIZE_PROP,DesignChoiceConstants.FONT_SIZE_MEDIUM);titleStyle.setProperty(StyleHandle.FONT_WEIGHT_PROP,DesignChoiceConstants.FONT_WEIGHT_BOLD);titleStyle.setProperty(StyleHandle.MARGIN_TOP_PROP, "10px");titleStyle.setProperty(StyleHandle.TEXT_ALIGN_PROP,DesignChoiceConstants.TEXT_ALIGN_LEFT);design.getStyles().add(titleStyle);StyleHandle styleHeader = efactory.newStyle("headerStyle");styleHeader.setProperty(StyleHandle.FONT_FAMILY_PROP, "Tahoma");styleHeader.setProperty(StyleHandle.FONT_WEIGHT_PROP,DesignChoiceConstants.FONT_WEIGHT_BOLD);styleHeader.setProperty(StyleHandle.FONT_SIZE_PROP,DesignChoiceConstants.FONT_SIZE_SMALL);styleHeader.setProperty(StyleHandle.TEXT_ALIGN_PROP,DesignChoiceConstants.TEXT_ALIGN_LEFT);design.getStyles().add(styleHeader);StyleHandle style1 = efactory.newStyle("groupStyle");style1.setProperty(StyleHandle.FONT_FAMILY_PROP, "Tahoma");style1.setProperty(StyleHandle.BACKGROUND_COLOR_PROP, "#F1C3C3");style1.setProperty(StyleHandle.FONT_WEIGHT_PROP,DesignChoiceConstants.FONT_WEIGHT_BOLD);style1.setProperty(StyleHandle.FONT_SIZE_PROP,DesignChoiceConstants.FONT_SIZE_SMALL);design.getStyles().add(style1);StyleHandle style2 = efactory.newStyle("contentStyle");style2.setProperty(StyleHandle.FONT_FAMILY_PROP, "Tahoma");style2.setProperty(StyleHandle.FONT_SIZE_PROP,DesignChoiceConstants.FONT_SIZE_SMALL);design.getStyles().add(style2);}/*** Renders the report into a particular file type. The possible file types* are html, pdf, xls and doc.* *
@param
fileName* The file name where the rendered report should be stored*
@param
fileType* The file type identifier*
@throws
EngineException*/private static void renderToFile(String fileName, String fileType)throws EngineException {IRunAndRenderTask runTask = getRunnableTask();final RenderOption OPTIONS = new RenderOption();OPTIONS.setOutputFileName(fileName);OPTIONS.setOutputFormat(fileType);runTask.setRenderOption(OPTIONS);runTask.run();runTask.close();}private static IRunAndRenderTask getRunnableTask() throws EngineException {IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);IReportEngine engine = factory.createReportEngine(engineConfig);IReportRunnable report = engine.openReportDesign(design);IRunAndRenderTask runTask = engine.createRunAndRenderTask(report);return runTask;}private static void close() {Platform.shutdown();System.out.print("Finished");}public static void main(String[] args) {try {ReportGenerator.generateReport();ReportGenerator.close();} catch (Exception e) {// TODO Auto-generated catch blocke.printStackTrace();}}}</pre></div><p> </p>
jgfelix
<p>Hi mwilliams,</p><p> </p><p>I've the same problem. I'm using BIRT runtime 4.2.2.</p><p><span><span>Occurs only</span> <span>in</span> <span>the group header</span> <span>and</span> <span>group footer</span></span>!</p><p>See the .rptdesign, the _1 are <span><span>duplicated!</span></span></p><pre class="_prettyXprint _lang-xml _linenums:0"><list-property name="boundDataColumns"> <structure> <property name="name">COD_USUARIO</property> <expression name="expression">dataSetRow["COD_USUARIO"]</expression> </structure> <structure> <property name="name">tableGroup1COUNTCOD_USUARIO</property> <expression name="expression">dataSetRow["COD_USUARIO"]</expression> <simple-property-list name="aggregateOn"> <value>tableGroup1</value> </simple-property-list> <property name="aggregateFunction">count</property> </structure> <structure> <property name="name">COD_PROCESSO</property> <expression name="expression">dataSetRow["COD_PROCESSO"]</expression> </structure> <structure> <property name="name">COUNTCOD_PROCESSO</property> <expression name="expression">dataSetRow["COD_PROCESSO"]</expression> <property name="aggregateFunction">count</property> </structure> <structure> <property name="name">COD_USUARIO_1</property> <expression name="expression">dataSetRow["COD_USUARIO"]</expression> <simple-property-list name="aggregateOn"> <value>tableGroup1</value> </simple-property-list> </structure> <structure> <property name="name">tableGroup1COUNTCOD_USUARIO_1</property> <expression name="expression">dataSetRow["tableGroup1COUNTCOD_USUARIO"]</expression> <simple-property-list name="aggregateOn"> <value>tableGroup1</value> </simple-property-list> </structure> </list-property></pre>
mwilliams
<p>Sorry for the delay. I'm taking a look now. Have you tried this in the latest release (BIRT 4.3)?</p>
mwilliams
<p>I'm currently getting this error with the code. Trying to figure out what the problem is right now.</p><p> </p><p></p><pre class="_prettyXprint _linenums:0">org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.at org.eclipse.birt.report.engine.api.impl.EngineTask.handleFatalExceptions(EngineTask.java:2329)at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:191)at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)at ReportGenerator.renderToFile(ReportGenerator.java:368)at ReportGenerator.generateReport(ReportGenerator.java:98)at ReportGenerator.main(ReportGenerator.java:389)Caused by: java.lang.IllegalArgumentException: The context can not be null when creating a structure handle!at org.eclipse.birt.report.model.api.StructureHandle.checkValidation(StructureHandle.java:142)at org.eclipse.birt.report.model.api.StructureHandle.<init>(StructureHandle.java:136)at org.eclipse.birt.report.model.api.ComputedColumnHandle.<init>(ComputedColumnHandle.java:45)at org.eclipse.birt.report.model.api.elements.structures.ComputedColumn.handle(ComputedColumn.java:310)at org.eclipse.birt.report.model.core.Structure.getHandle(Structure.java:445)at org.eclipse.birt.report.model.api.StructureIterator.next(StructureIterator.java:108)at org.eclipse.birt.report.engine.parser.EngineIRVisitor.getColumnBindingByName(EngineIRVisitor.java:1186)at org.eclipse.birt.report.engine.parser.EngineIRVisitor.getColumnBinding(EngineIRVisitor.java:1174)at org.eclipse.birt.report.engine.parser.EngineIRVisitor.hasExpression(EngineIRVisitor.java:1125)at org.eclipse.birt.report.engine.parser.EngineIRVisitor.locateGroupIcon(EngineIRVisitor.java:1075)at org.eclipse.birt.report.engine.parser.EngineIRVisitor.visitTable(EngineIRVisitor.java:963)at org.eclipse.birt.report.engine.parser.MultiViewEngineIRVisitor.visitTable(MultiViewEngineIRVisitor.java:70)at org.eclipse.birt.report.model.api.DesignVisitorImpl$Forwarder.visitTable(DesignVisitorImpl.java:1100)at org.eclipse.birt.report.model.elements.TableItem.apply(TableItem.java:91)at org.eclipse.birt.report.model.api.DesignVisitorImpl.apply(DesignVisitorImpl.java:127)at org.eclipse.birt.report.engine.parser.EngineIRVisitor.visitReportDesign(EngineIRVisitor.java:414)at org.eclipse.birt.report.model.api.DesignVisitorImpl$Forwarder.visitReportDesign(DesignVisitorImpl.java:1222)at org.eclipse.birt.report.model.elements.ReportDesign.apply(ReportDesign.java:65)at org.eclipse.birt.report.model.api.DesignVisitorImpl.apply(DesignVisitorImpl.java:127)at org.eclipse.birt.report.engine.parser.EngineIRVisitor.translate(EngineIRVisitor.java:276)at org.eclipse.birt.report.engine.parser.ReportParser.parse(ReportParser.java:178)at org.eclipse.birt.report.engine.executor.ExecutionContext.getReport(ExecutionContext.java:2208)at org.eclipse.birt.report.engine.executor.ReportExecutor.<init>(ReportExecutor.java:86)at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:107)... 4 more </pre>
mariaux
<p>Hi mwilliams, thanks for taking a look at this! </p><p> </p><p>That is the error I get when trying to render after saveAs. If you comment the last two lines in the function generateReport, the error goes away.</p><pre class="_prettyXprint">renderToFile("c:temptestswrongBinding2.pdf", "pdf");renderToFile("c:temptestswrongBinding2.html", "html");</pre><p>If you open the .rptdesign with the eclipse plugin you will see the problem is an extra binding to a field that doesn't exist.</p><p> </p><p>I will test with version 4.3 and I will let you know. Thanks!</p>
mariaux
<p>Hi,</p><p> </p><p>I just tried with version 4.3 but exactly the same error occurs. Any help is very appreciated. I need to find a workaround for this problem in no time. </p><p> </p><p>Many thanks!</p><p> </p><p>Maria </p>
mwilliams
I see, now. I'm taking a closer look, right now. I'll let you know if I find a way to stop this from happening.
mwilliams
This definitely seems to be a bug. I got close to getting around it, it seemed, but then it still didn't quite work. Can you log a bug for this? You might try adding beforeFactory script to the report to add the grouping and filter and see if that changes how it works.