I am using Eclipse's BIRT to render a report through Java using org.eclipse.birt.runtime version 4.4.0.
When attempting to render the report, BIRT is returning:
org.eclipse.birt.data.engine.core.DataException: Invalid Javascript expression: dataSetRow["name"].
(and similar errors for each dataSetRow and row) in .getErrors() of the IRunAndRenderTask;
The template works fine using the BIRT designer and rendering it through that application, but it breaks when trying to render using Java.
I've done extensive searching throughout the web, and many people have suggested the presence of conflicting js.jar present in the application. This is not the case in the application I'm working on. The only javascript/rhino instances are those being imported through BIRT.
I've also attempted the following solutions:
- Excluding the bundled javascript and importing latest Rhino/javascript from Mozilla
- Updating BIRT to
4.4.1and creating a report template with the latest BIRT designer - Degrading the report template to only show one value returned by the DB (in this case 'name' of a dealership)
This project is using Maven, and is running in Tomcat 7 - using Java 6.
The database is using mysql.
More details can be provided if requested.
EDIT: Been fiddling around with this problem for a little bit and have found the following:
- Basic reports that do not hit the database render fine - even javascript expressions
- Once I attempt to get datasets out of a query, then the Invalid Javascript expression gets thrown, for e.g. in this section of the template:
<data id="624"> <property name="dataSet">Dealership</property> <list-property name="boundDataColumns"> <structure> <property name="name">name</property> <text-property name="displayName">name</text-property> <expression name="expression" type="javascript">dataSetRow["name"]</expression> <property name="dataType">string</property> </structure> </list-property> <property name="resultSetColumn">name</property> </data>- Any value placed in the above
datasetRowsection throws an Invalid Javascript error
- Any value placed in the above
<expression name="expression" type="javascript">"Hello" + "World" + params["testparam"]</expression>and it renders fine. I haven't split it intorunandrender, right now I'm only doing:task.run();task.close();and it seems to be doing fine. I will try to do run and then render. The fact that it works without a DB makes me think that the driver is acting up or something... not sure - I've looked into adding the driver (mysql) but can't find the proper maven dependency. - kahyoung