Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[birt-report-engine-dev] Pass Java object to BIRT Viewer

I am working on integrating birt reporting framework with webwork based web
application. I am trying to solve following integration scenario and got it
working as mentioned below:

Use case scenario
-------------------
1. There is a search screen that has many search parameters as input text
fields
2. The submitted request (HTTP POST) is handled by an action class and
finally the result is made available in the form of a collection (as an
attribute of action class)
3. Now I want this collection result to feed to birt reporting framework

Solution 
--------
1. Action class puts the collection object into session (say with attribute
"javaBean")
2. Now it forwards the request to Birt viewer (i.e. viewerServlet) by
appending report name (.rptdesign file). The reason we put collection data
in session and not in request is because: BIRt viewer will send AJAX based
request  to fetch report data and with request we loose this data.

3. Within the report design file, I have added following event handler code
associated with dataset
beforeOpen: dataCollection =
reportContext.getHttpservletRequest().getSession().getAttribute("javaBean");
fetch: here I can traverse the dataCollection 

This solution works but doesn't work out well since we are using session to
share data. Additionally this data cannot be removed from session (at
afterClose event) because one may want to perform column sorting.

Is there a better way to solve this problem ? Any pointers/code sample will
be of great help. 
-- 
View this message in context: http://www.nabble.com/Pass-Java-object-to-BIRT-Viewer-tf4061801.html#a11539951
Sent from the Eclipse BIRT - Report Engine - Dev mailing list archive at Nabble.com.



Back to the top