Community
Participate
Working Groups
Build Identifier: 20110916-0149 I'm receiving the "is not a function, it is object" when creating a Joined Data Set with a Scripted Data Source. I know the scripted data source works because the data is fetched in the "preview results" step correctly. The error occurs when I choose OK to save the Data Set. The error and issue seems identical to the one described in this post: http://www.eclipse.org/forums/index.php/t/201442/ ,however the solution that worked there is not working here. I have added my jar to the scriptlib and WEB-INF/lib folders of the report.viewer plugin. I have added my jar to the classpath of both java and report builder as an external jar using the full path. I've event tried adding the jar to the jvm classpath. Reproducible: Always Steps to Reproduce: 1. Create a scripted data source 2. Use it in a Joined Data Set
Here is the full text of the error: A BIRT exception occurred. Plug-in Provider:Eclipse BIRT Project Plug-in Name:BIRT Data Engine Plug-in ID:org.eclipse.birt.data Version:3.7.1.v20110905 Error Code:data.engine.FailToExecuteScript Error Message:Fail to execute script in function __bm_open(). Source: ------ " + importPackage(Packages.com.groupbasis.json); // This will track the current row later on count = 0; // Create instance of the Controller class parser = new Packages.com.groupbasis.json.MKLiveStatusParser(); // Load the JSON Source parser.loadData("http://192.168.122.65/gbutils/live.php?q=GET%20hosts%0AColumns:%20name%20state%0A"); // Calculate the total rows we will have totalCount = parser.getTotalCount(); + " ----- A BIRT exception occurred. See next exception for more information. Error evaluating Javascript expression. Script engine error: TypeError: [JavaPackage com.groupbasis.json.MKLiveStatusParser] is not a function, it is object. (<inline>#7) Script source: <inline>, line: 0, text: __bm_open()
I can't reproduce this issue with latest birt. If you can still reproduce it,could you provide more detail information about how to reproduce it or a sample report I can test with.
Created attachment 206292 [details] report containing the json joint dataset testcase
Created attachment 206294 [details] birt json error 1 Error received when clicking finish in the Joint Dataset wizard.
Created attachment 206295 [details] birt json error 2 Screenshot showing that the scripted datasets are functioning and that data is fetched correctly.
Created attachment 206296 [details] birt json error 3 Screenshot showing that the error is generated again upon clicking "OK" to close the edit dataset dialog.
Created attachment 206297 [details] birt json error 4 Screenshot showing that the joint dataset is generated but now fields are available for inclusion in the report.
Created attachment 206298 [details] json.jar Jar file containing the json dependencies the scripted datasources. The source is probably al little dated and could be updated from the git repository, but the all test cases indicate that the code works for this data set.
I've attached an example report that demonstrates the error along with the json.jar dependency and screenshots that show the behaviour I am experiencing.
I can run your report without errors. Please try again and follow these steps: 1,open your report 2,click layout 3,property editor->properties->Resource tab 4,add your jar file 5,No error occur when choose OK to save the data set
Thanks Xiaoying, That solved my error.