Skip to main content



      Home
Home » Archived » 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 13:46 Go to next message
Eclipse UserFriend
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 14:07 Go to previous messageGo to next message
Eclipse UserFriend
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 02:32 Go to previous messageGo to next message
Eclipse UserFriend
Perfect!

Thanks.
Re: How access to servlet context parameters from birt javascript? [message #1257518 is a reply to message #780881] Wed, 26 February 2014 09:18 Go to previous message
Eclipse UserFriend
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 Jul 23 08:02:35 EDT 2025

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

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

Back to the top