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)
ScriptedDataSetEventAdapter
bigzaqui
Hi,
(My objetive: Modify the value of a row using A Java class event handler.)
I've found that extending my class from "ScriptedDataSetEventAdapter" I can override the Fetch function and I should be able to modify the value using the setColumnValue() function from the IUpdatableDataSetRow class. The problem is that no matter what I do, for some reason my code is not being executed, even though the Onfetch() code is working fine.
If I Override any of the functions from the ScriptedDataSetEventAdapter (fetch,open,close,describe) nothing happens, but If I modify the functions from the DataSetEventAdapter (onfetch...) they work... Could you please tell what's going on?
thanks for your help
PS: My class is Attached.
Find more posts tagged with
Comments
CBR
Hi,
is your data set a scripted data set or any other data set (like a SQL, XML, webservice, ... data set)?
The ScriptedDataSet Event handler can only be applied to a scripted data set.
Are you able to provide a simple sample based on the sample database?
bigzaqui
<blockquote class='ipsBlockquote' data-author="'cbrell'" data-cid="99951" data-time="1336074347" data-date="03 May 2012 - 12:45 PM"><p>
Hi,<br />
<br />
is your data set a scripted data set or any other data set (like a SQL, XML, webservice, ... data set)?<br />
<br />
The ScriptedDataSet Event handler can only be applied to a scripted data set.<br />
Are you able to provide a simple sample based on the sample database?<br /></p></blockquote>
<br />
Thanks for your reply.<br />
<br />
I'm using a BIRT JDBC data source (connecting with a Postgresql DB), the Data set Type is "SQL select query", is that the reason why my code is not executing?<br />
<br />
PS: I was able to modify the value of the rows using javascript inside the "Onfetch" event from the data source, now I'm trying to do it with the Java Handler. How would you do it under my circumstances?
CBR
Yes, that's it. The scripted data set event handler interface and the ScriptedDataSetEventAdapter can only be used for a scripted data set. A scripted data set is a data set that fetches data from Rhino or Java code. You are using a sql data source.
So your class needs to implement the DataSetEventHandler interface or extend the DataSetEventAdapter class.
bigzaqui
<blockquote class='ipsBlockquote' data-author="'cbrell'" data-cid="99963" data-time="1336112735" data-date="03 May 2012 - 11:25 PM"><p>
Yes, that's it. The scripted data set event handler interface and the ScriptedDataSetEventAdapter can only be used for a scripted data set. A scripted data set is a data set that fetches data from Rhino or Java code. You are using a sql data source.<br />
So your class needs to implement the DataSetEventHandler interface or extend the DataSetEventAdapter class.<br /></p></blockquote>
<br />
The thing is that none of those classes(interface or adapter) give me a way to modify the value of the row, just to read it. I'm able to modify the value on Javascript using row["columname"] = "foo" inside the OnFetch event from the Event Handler. Any ideas how to do this using java?<br />
<br />
thanks for your reply
CBR
sorry what i said earlier is not correct. I tried and the ScriptedDataSet interface and adapter works for other data sets as well. Just use the fetch method to modify column values.
Another nasty trap is the usage of Javascript event handler as well as Java event handlers for the same element. When the report is run BIRT first checks for the existence of Javascript code in the event handler for each single element. If a element has both Java will always be ignored. Can you have a look if you have somehting in the script tab for any event for that dataset?