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)
Webviewer problem with scripted data source in Spring J2EE web application
pauljin
Hi
I am not sure whether this question is answered in earlier threads .I searched for it lot but I didn't find any answer .
I have a spring application in which web viewer which is deployed by using ECLIPSE create BIRT RUNTIME project option. Now I have a chart which make use of scripted data source . I pass the java bean to the chart through report request object. The scipted dataset open event gets the request attribute from the http request object and make use of data in it.
The strange problem is that when I execute this report in jsp using birt:report tag it perfectly works well. But as soon as I use birt:viewer tag it gives me errors such as
egine.exception :there are errors in evaluating script
I have attached a pic which shows the stack trace
If any one knows why it is happening please let me know.....
Find more posts tagged with
Comments
JasonW
Can you post the report?
Jason
pauljin
Hi Jason
thank you for replying
my chart uses one event handler called gaugeHandler. I have included it at the end of this note.....
the chart get data from http request object and fetches the data from it .When I used birt:viewer it started giving me problem . but with birt:report it works very well
I have attached my .rptdesign file and event handler here
At first I though birt viewer requires jar files in scriptlib folder and later
removed the event handler to test if it is something wrong with that . But then again it was same problem all over again....
DO I have to do something extra to get webviewer to read http request object????
I am so curious to learn the cause
thanks once again for your help
pauljin
This is the error stack I got when I tried to use birt:viewer
JasonW
Did you get a logfile for this? look at the viewers web.xml to configure it.
Also can you try a simple report to if it works?
Jason
pauljin
Hi Jason
I have configured the birt log location to '/report/birtlogs' in web.xml . But to my surprise I didn't find any logs
But I tried to run different types of simple reports with webviewer. And all the report except those which takes data from http request object worked well.
In order to use the http request object I just decalred a variable in open event as follows.
var request = reportContext.getHttpServletRequest();
gauge = request.getAttribute("var"); //var is javabean
birt:report tag has no hassle in making use of this data
but birt:viewer fails to read the data
do I have to set any more parameters so that birt:viewer will have access to application's request object???
madhu_2009
Hi Jason,
Iam new to BIRT..
Even I have tried using the birt:viewer,even I have ended up getting the similar error...
Also i need another help in deploying the BIRT report in jsp page...
Im using Actuate BIRT release 10 version.. But iam really stuck up in writing a jsp page where i can deploy the birt report...
Earlier I worked with BIRT 2.3.1. There I am able to deploy using birt:report where as that does not work in actuate birt reports..
Please help me...
Rgds,
Madhu
JasonW
Paul,
I am a little confused does the scripted dataset work when the Java class for it is in the scriptlib directory? I know you said it worked for the report tag but not the viewer tag. In this case where was the class?
Also what version of BIRT are you using?
Jason
JasonW
Madhu,<br />
<br />
If you are deploying your reports using Actuate 10, take a look at using the JSAPI. It is very simple to include a report in another JSP page.<br />
<br />
Take a look at:<br />
<a class='bbc_url' href='
http://www.birt-exchange.com/devshare/deploying-birt-reports/594-showing-birt-reports-using-the-actuate-jsapi/'>Showing
BIRT Reports using the Actuate JSAPI - Articles - BIRT Exchange</a><br />
<br />
Jason
pauljin
Hi Jason
Acutually there is no class where BIRT which birt directly refer. I am creating a java bean in application and then set it as a attribute in http request object . BIRT access request object and get the java bean from its attributes. (eg.var request = reportContext.getHttpServletRequest();gauge = request.getAttribute("<name of the javabean attribute>");
I was able to makeitwork with birt:report tag but birt:viewer is not able to get the request object. I guess when I use birt:viewer request object is not directly visible to birt. Just some speculations...what do you think about it???
Do I have to set any context parameters so that birt:viewer tag will access http requestobject
JasonW
Paul,
It may be a good idea to log a bug for this, but you could try moving the script to the beforeFactory script and try to get the request there and set it to a variable that is then used in the beforeOpen of the SDS.
Take a look at this example.
Jason
pauljin
Hi Jason
I raised Bug 271601 for this isssue..