Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How access to servlet context parameters from birt javascript?(Access servlet context parameters from birt report script.)
How access to servlet context parameters from birt javascript? [message #780873] Thu, 19 January 2012 18:46 Go to next message
Angel Cervera Claudio is currently offline Angel Cervera ClaudioFriend
Messages: 2
Registered: January 2012
Junior Member
I have a report with a dynamic xml file as datasource.
This file is generated previously to launch the report and is send like a report parameter.

So I declared a datasource with target in "property binding":

"/path_to_folder_with_generated_files/data/" + params["dynamic_xml_file"].value


At this point, go all right.

But i need that "/path_to_folder_with_generated_files/data/" will be

{BIRT_VIEWER_WORKING_FOLDER} + "/data/" + params["dynamic_xml_file"].value


where {BIRT_VIEWER_WORKING_FOLDER} will be the value of this context parameter declared in web.xml deploy descriptor.

How do i access to context parameters from birt javascript?



Environment: Birt 3.7.1 deployed in Glassfish 3.1, ubuntu linux, jdk 1.6
Re: How access to servlet context parameters from birt javascript? [message #780881 is a reply to message #780873] Thu, 19 January 2012 19:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Try:
req =reportContext.getHttpServletRequest();
sc = req.getSession().getServletContext();
//xyz = sc.getRealPath("/");
var workingpath =sc.getInitParameter("BIRT_VIEWER_WORKING_FOLDER");

This will not work in the designer but should work in the deployed
viewer. You could also use getRealPath which should work in both.

Jason

On 1/19/2012 1:46 PM, Angel Cervera Claudio wrote:
> I have a report with a dynamic xml file as datasource.
> This file is generated previously to launch the report and is send like
> a report parameter.
>
> So I declared a datasource with target in "property binding":
>
> "/path_to_folder_with_generated_files/data/" +
> params["dynamic_xml_file"].value
>
> At this point, go all right.
>
> But i need that "/path_to_folder_with_generated_files/data/" will be
>
> {BIRT_VIEWER_WORKING_FOLDER} + "/data/" + params["dynamic_xml_file"].value
>
> where {BIRT_VIEWER_WORKING_FOLDER} will be the value of this context
> parameter declared in web.xml deploy descriptor.
>
> How do i access to context parameters from birt javascript?
>
>
>
> Environment: Birt 3.7.1 deployed in Glassfish 3.1, ubuntu linux, jdk 1.6
Re: How access to servlet context parameters from birt javascript? [message #780953 is a reply to message #780881] Fri, 20 January 2012 07:32 Go to previous messageGo to next message
Angel Cervera Claudio is currently offline Angel Cervera ClaudioFriend
Messages: 2
Registered: January 2012
Junior Member
Perfect!

Thanks.
Re: How access to servlet context parameters from birt javascript? [message #1257518 is a reply to message #780881] Wed, 26 February 2014 14:18 Go to previous message
Mohammed Nami is currently offline Mohammed NamiFriend
Messages: 1
Registered: February 2014
Junior Member
Hi;
it's work on production server. thanks.
Previous Topic:Header auto height?
Next Topic:Chart x-Axis zoom out /in in some range?
Goto Forum:
  


Current Time: Wed Nov 26 14:19:22 GMT 2014

Powered by FUDForum. Page generated in 0.01798 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software