Scripted Dataset handler open event.
Options
Comments
-
Ok, I now understand that a scripted data set event handler will be called multiple times if the scripted data set is bound to more than one report item.
What if a scripted data set is bound to a report item and also used in a join with another data set (the join is then bound to a chart) will this mean that the scripted data set events will be called twice?
Further is it possible to define a scripted data source, override the open() event handler for the scripted data source to retrieve the required data for the report and reference this scripted data source in the reports scripted data sets so that the scripted data is retrieved only once?
Thanks.0 -
Is it possible to define a scripted data source, override the beforeOpen() event handler for the scripted data source to retrieve the required data for the report and reference this scripted data source in the reports scripted data sets so that the scripted data is retrieved only once?
It seems that this should be possible from the "Integrating and Extending BIRT" book on pg 118 it says:
"About data source and data set events
Events for data source and data set elements trigger just prior to creating the
report item bound to the data set. This sequence occurs for every report item
bound to a data set with the exception of the data source beforeOpen and
afterOpen events. These events do not trigger if a data source has already been used."
However, the beforeOpen event handler in my case is being called multiple times. Any ideas as to why this would be the case?
Thanks.0 -
The purpose of the open event is to populate your data model (array of java objects generally) with data. If you want to do this once and only once, move this action to a script that fires off once.
The issue is accessing the array of Java Objects (each of which being a "row" on your data set). The use of a Persistent global variable inside a BIRT Report will make your variable (array) available across different controls on the report. In order to set a persistent global variable your target value needs to be serializable. If this is a huge hit in terms of resources, that may be worth implementing.
I can try and work up a test case for this today or early tomorrow. I have not tried this out personally, but in theory it should work fine.Warning No formatter is installed for the format ipb0 -
Thanks for your reply Brian ....
"The purpose of the open event is to populate your data model (array of java objects generally) with data. If you want to do this once and only once, move this action to a script that fires off once. "
That is exactly what I'm trying to do ... but the beforeOpen event of the scriptedDataSource, in my case, fires more than once. Should this be the case or am I doing something wrong? If I can't put the script (ie my Java Event Handler - not javascript) in the beforeOpen method then where can I put it? I need access to the reportcontext to retrieve report parameters and also I would prefer it if I can "unpack" any array of data in a scripted data set as I need to do joins between two datasets.
"The issue is accessing the array of Java Objects (each of which being a "row" on your data set). The use of a Persistent global variable inside a BIRT Report will make your variable (array) available across different controls on the report. In order to set a persistent global variable your target value needs to be serializable. If this is a huge hit in terms of resources, that may be worth implementing. "
My biggest performance hit at the moment is a hibernate query to retrieve the data.
So BIRT doesn't do data caching? Should I be able to use joint datasets so that I don't get into a "data" binding issue? ie repeated calls to the scripted dataset?
"I can try and work up a test case for this today or early tomorrow. I have not tried this out personally, but in theory it should work fine. "
Any help will be much appreciated. Thanks.0 -
Hi,<br />
<br />
I am having the same issue with the scripted data set being called multiple times due to the fact that the scripted dataset is being binded to different elements in the report.<br />
<br />
Did anyone find a solution to this? <a class='bbc_url' href='http://www.birt-exchange.org/org/forum/public/style_emoticons/'>http://www.birt-exchange.org/org/forum/public/style_emoticons/</a><#EMO_DIR#>/confused.gif <br />
<br />
Thanks<br />
UYWarning No formatter is installed for the format ipb0 -
I could find and implement the solution from this post. Hope this helps someone with the similar issue.
Using the 'before factory' event to call the java method did the trick.
http://www.eclipse.org/forums/index.php/m/843198/#msg_843198
Thanks
UYWarning No formatter is installed for the format ipb0 -
<p>Can anyone find a solution for this problem. I am using 2 datasource in beforeopen method and only one function is working and another not working.</p>
<p> </p>
<p>Thanks in advance</p>
0 -
<p>Is really community is active ???</p>
0
Categories
- All Categories
- 111 Developer Announcements
- 49 Articles
- 103 General Questions
- 123 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 123 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 1 XM Fax