Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
scripted dataset
Atena
Hi,
I am a beginner in Birt. I must generate a report from Java Object (a list with Dao Spring, JSF) provides. I've tried with scripted dataset. This does not work.
my code in Java looks like this.
private List getData <Data> (User uId, Type typeid) {
.....
List result = <Data> meinDao.getAllData (criteria);
return result;
}
How can I get this list in Birt. I've tried several times to solve the problem without success.
I thank you in advance for the help
Find more posts tagged with
Comments
mwilliams
In a scripted dataSet, it essentially works like this:
In the open script, you grab the data, check the length of the data and store to a variable, and then set a currentRow = 0 value.
In the fetch script, you assign the values from the returned array or hashmap or whatever to your rows and increment your currentRow. When your current row is the last row according to the length of the data you determined, you'll return false so the dataSet knows you're done, otherwise you return true. Be sure to define your output columns in the dataSet editor as well.
Have you looked at the POJO examples that are available in the devShare?
http://www.birt-exchange.org/org/devshare/?topicid=0&filtercontent=pojo&contenttype=&timeperiod=0&results=10
Atena
thanks for the reply.
I'm working with Spring and JSF. Somehow I do not get the list. I tried another example and it works without Spring.
Can I generated report without copy classes into Birt Classpath?
mwilliams
Here are a couple devShare posts that show how to access spring beans from BIRT. Maybe they'll help:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1082-accessing-spring-beans-from-birt-reports/
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1096-remote-spring-beans-from-birt/
Actuate BIRT has a POJO ODA Driver to simplify the process of using a POJO as a dataSource.
Atena
Hi,
I can only run my report, wenn my application is run and selected the Data from the database
When I test my report(with 2 parameters manual )on my browser it works fine, but I need two parameters from Java Obejct
Like this:
favoritesClass= new Packages.de.XXXX.MyReport()
var request = reportContext.getHttpServletRequest().getSession().getServletContext();
favorites=favoritesClass.getmykValues( "user", ??typ?,request);
count=0;
I have defined in the dataset 2 parameters, but I get the error :data.engine.BadFetchScriptReturnType.
How do I passed the parameters?
Thanks a lot in advance
PS. Sorry fpor my bad english ?
mwilliams
From the error, it sounds like a value that you're returning is not the same as the datatype set for the column.