Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » how to get request url in scripting(drilldown using URI)?
how to get request url in scripting(drilldown using URI)? [message #634869] Sun, 24 October 2010 18:41 Go to next message
Dean Hiller is currently offline Dean Hiller
Messages: 46
Registered: July 2009
Member
I am trying to script in the drilldown URI field. Previously, I had

"reports.xhtml?report=subs/Account_Statistics&accountno= "
+row["ACCOUNTNO"]+"&type=HTML"+"&fromDate=" +params["fromDate"].value+"&toDate="+params["toDate "].value":

in my url, but I want to prepend it with

baseUrl = servletCtx.getRequestUrl();
"https://"+baseUrl+ <all the above url>

How do I do that? It looks like I can script inside the URI in the xml source directly. Also, the second question is what do I call to detemine if I am in a pdf report, or xls report oor html report as it would be nice to override the type=HTML above to be the type the link I am generating for(otherwise, the pdfs are linked to an html report instead of the next pdf).

any ideas on this?

I was trying

var ctx = icsc.getChartInstance();
var rptCtx = ctx.getExternalContext().getScriptable();
rptCtx.getHttpServletRequest().getRequestURL()+
"reports.xhtml?report=subs/Account_Statistics&accountno= "
+row["ACCOUNTNO"]+"&type=HTML"+"&fromDate="
+params["fromDate"].value+"&toDate="+params["toDate "].value":


but icsc is not found. how to bootstrap in getting into the context?


thanks,
Dean

Re: how to get request url in scripting(drilldown using URI)? [message #635104 is a reply to message #634869] Mon, 25 October 2010 15:04 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Dean,

Where do you have this script currently?

Jason

On 10/24/2010 2:41 PM, Dean Hiller wrote:
> I am trying to script in the drilldown URI field. Previously, I had
> "reports.xhtml?report=subs/Account_Statistics&accountno= "
> +row["ACCOUNTNO"]+"&type=HTML"+"&fromDate="
> +params["fromDate"].value+"&toDate="+params["toDate "].value":
>
> in my url, but I want to prepend it with
>
> baseUrl = servletCtx.getRequestUrl();
> "https://"+baseUrl+ <all the above url>
>
> How do I do that? It looks like I can script inside the URI in the xml
> source directly. Also, the second question is what do I call to detemine
> if I am in a pdf report, or xls report oor html report as it would be
> nice to override the type=HTML above to be the type the link I am
> generating for(otherwise, the pdfs are linked to an html report instead
> of the next pdf).
>
> any ideas on this?
>
> I was trying
> var ctx = icsc.getChartInstance();
> var rptCtx = ctx.getExternalContext().getScriptable();
> rptCtx.getHttpServletRequest().getRequestURL()+
> "reports.xhtml?report=subs/Account_Statistics&accountno= "
> +row["ACCOUNTNO"]+"&type=HTML"+"&fromDate="
> +params["fromDate"].value+"&toDate="+params["toDate "].value":
>
>
> but icsc is not found. how to bootstrap in getting into the context?
>
>
> thanks,
> Dean
>
>
Re: how to get request url in scripting(drilldown using URI)? [message #635105 is a reply to message #635104] Mon, 25 October 2010 15:20 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

BTW have you tried

if( reportContext.getHttpServletRequest() !=null){
var myurl =reportContext.getHttpServletRequest().getRequestURL();
var myout = reportContext.getOutputFormat();
}

Jason


On 10/25/2010 11:04 AM, Jason Weathersby wrote:
> Dean,
>
> Where do you have this script currently?
>
> Jason
>
> On 10/24/2010 2:41 PM, Dean Hiller wrote:
>> I am trying to script in the drilldown URI field. Previously, I had
>> "reports.xhtml?report=subs/Account_Statistics&accountno= "
>> +row["ACCOUNTNO"]+"&type=HTML"+"&fromDate="
>> +params["fromDate"].value+"&toDate="+params["toDate "].value":
>>
>> in my url, but I want to prepend it with
>>
>> baseUrl = servletCtx.getRequestUrl();
>> "https://"+baseUrl+ <all the above url>
>>
>> How do I do that? It looks like I can script inside the URI in the xml
>> source directly. Also, the second question is what do I call to detemine
>> if I am in a pdf report, or xls report oor html report as it would be
>> nice to override the type=HTML above to be the type the link I am
>> generating for(otherwise, the pdfs are linked to an html report instead
>> of the next pdf).
>>
>> any ideas on this?
>>
>> I was trying
>> var ctx = icsc.getChartInstance();
>> var rptCtx = ctx.getExternalContext().getScriptable();
>> rptCtx.getHttpServletRequest().getRequestURL()+
>> "reports.xhtml?report=subs/Account_Statistics&accountno= "
>> +row["ACCOUNTNO"]+"&type=HTML"+"&fromDate="
>> +params["fromDate"].value+"&toDate="+params["toDate "].value":
>>
>>
>> but icsc is not found. how to bootstrap in getting into the context?
>>
>>
>> thanks,
>> Dean
>>
>>
>
Previous Topic: Oracle Proxy Authentication and BIRT
Next Topic:Version error with runtime 2.6.1
Goto Forum:
  


Current Time: Fri Sep 19 17:54:24 GMT 2014

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

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