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)
Passing List object to a dataset using scripted data sets
ravi11
<p>Hi,</p>
<p> </p>
<p>I am trying to develope a rptdesign using birt api engine and write code for getting data using scripted data sets.</p>
<p> </p>
<p>I am able to produce one by using below script</p>
<p> </p>
<p> </p>
<p> Line 1: reportDesignHandle.setBeforeFactory("importPackage(Packages.java.util); \n"+<br>
Line 2: "importPackage(Packages.java.lang); \n" +<br>
Line 3: "pagesList = new ArrayList(); \n"+<br>
Line 4: "pojo = new Packages.com.birt.logic.ReportFactory; \n"+<br>
Line 5: "<strong>pagesList</strong> = pojo.getDataPages("+reportId+"); \n" +<br>
Line 6: "reportContext.getAppContext().put('ScriptedDataSetData', pagesList);" );</p>
<p> </p>
<p>Here I am getting pagesList by calling method from java class in line 5. But actually I dont need this call to happen as I already have the pagesList in this class itself. All i need is to assign the list object to a script,i.e.</p>
<p>in line 5 I need to give that list object to beforeFactory script <strong>pagesList</strong>.</p>
<p> </p>
<p>Please help me on this.</p>
<p> </p>
<p>Thanks,</p>
<p>Ravi</p>
<p> </p>
Find more posts tagged with
Comments
mwilliams
Can you explain more of what you're trying to do? If you're using this object in your scripted dataSet, why are you putting this code in the beforeFactory of the report design? Typically, you'd access your object in the open method of your scripted dataSet and then step through your object to create your rows. Since 4.3, there's also been a POJO datasource, if that would be easier to use for you. Maybe I'm misunderstanding something. Let me know.