how to get session attribute into reportContext? [message #245804] |
Mon, 02 July 2007 07:02 |
Eclipse User |
|
|
|
Originally posted by: amit.rajpurkar.pepsico.com.au
Hi,
I am trying to get a java object from HttpSession in the report file.
in the DataSet's open method:
importPackage(Packages.au.com.pepsico.birt.data);
importPackage(Packages.javax.servlet.http);
var listFromSession =
reportContext.getHttpSession().getAttribute("CONTENTLIST");
iter = listFromSession.iterator();
Am i missing something in the code???
Regards,
-Amit
|
|
|
Re: how to get session attribute into reportContext? [message #245926 is a reply to message #245804] |
Mon, 02 July 2007 14:33 |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Amit,
This looks correct. What error are you getting?
Jason
Amit Rajpurkar wrote:
> Hi,
>
> I am trying to get a java object from HttpSession in the report file.
>
> in the DataSet's open method:
> importPackage(Packages.au.com.pepsico.birt.data);
> importPackage(Packages.javax.servlet.http);
> var listFromSession =
> reportContext.getHttpSession().getAttribute("CONTENTLIST");
> iter = listFromSession.iterator();
>
>
> Am i missing something in the code???
>
> Regards,
> -Amit
>
|
|
|
Re: how to get session attribute into reportContext? [message #246009 is a reply to message #245926] |
Mon, 02 July 2007 23:27 |
Eclipse User |
|
|
|
Originally posted by: amit.rajpurkar.pepsico.com.au
Hi Jason,
Here was the error i got:
Caused by: org.eclipse.birt.data.engine.core.DataException: A BIRT
exception occurred: Error evaluating Javascript expression. Script engine
error: TypeError: getHttpSession is not a function. (DataSet[Data
Set].__bm_OPEN#6)
now i have changed this code to:
importPackage(Packages.au.com.pepsico.birt.data);
importPackage(Packages.javax.servlet.http);
importPackage(Packages.javax.servlet);
var request = reportContext.getHttpServletRequest();
var session = request.getSession();
var listFromSession = session.getAttribute("CONTENTLIST");
if(listFromSession != null){
iter = listFromSession.iterator();
}
this took away the error, but the report does not work.
i am using BIRT RCP designer 2.1.1 to develop reports. I use these reports
in a simple web application, in which a servlet calls a report design.
I found one more link:
http://wiki.eclipse.org/Retrieve_Session_information_in_Scri pt_(BIRT)
The sample i made following the above link works good in the preview
section of the designer;
But when i place the report in my web application, it shows a blank page.
From the servlet do i need to do something to send the session attributes
into the report?.
Regards,
-Amit
|
|
|
Re: how to get session attribute into reportContext? [message #246046 is a reply to message #246009] |
Tue, 03 July 2007 03:37 |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Amit,
I tried this report with BIRT 2.1.2 deployed to tomcat and it worked
fine. This may be an issue with 2.1.1.
Jason
Amit Rajpurkar wrote:
> Hi Jason,
>
> Here was the error i got:
> Caused by: org.eclipse.birt.data.engine.core.DataException: A BIRT
> exception occurred: Error evaluating Javascript expression. Script
> engine error: TypeError: getHttpSession is not a function. (DataSet[Data
> Set].__bm_OPEN#6)
>
> now i have changed this code to:
> importPackage(Packages.au.com.pepsico.birt.data);
> importPackage(Packages.javax.servlet.http);
> importPackage(Packages.javax.servlet);
>
> var request = reportContext.getHttpServletRequest();
> var session = request.getSession();
> var listFromSession = session.getAttribute("CONTENTLIST");
> if(listFromSession != null){
> iter = listFromSession.iterator();
> }
>
> this took away the error, but the report does not work.
>
> i am using BIRT RCP designer 2.1.1 to develop reports. I use these
> reports in a simple web application, in which a servlet calls a report
> design.
>
> I found one more link:
> http://wiki.eclipse.org/Retrieve_Session_information_in_Scri pt_(BIRT)
>
> The sample i made following the above link works good in the preview
> section of the designer; But when i place the report in my web
> application, it shows a blank page.
>
> From the servlet do i need to do something to send the session
> attributes into the report?.
>
>
> Regards,
> -Amit
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.05314 seconds