Creating dynamic URLs in your templates ...

More on URLs ... this time how to create a dynamic URL in your template to point to another report or another destination. Im going to talk about the Enterprise release primarily although the same general idea holds for Oracle Applications customers.


Once you have your basic template you'll need to add a URL to a form field, easily done, just highlight the field, right click and select Add Hyperlink. You now get a dialog to add the URL.


So the basic URL to drill to another report is going to look something like the URLs we discussed yesterday:
 http://server:port/xmlpserver/ReportDirectory/ReportName.xdo + parameters
at runtime this looks something like


 http://xdopf.us.oracle.com/xmlpserver/Private/SalaryReport/SalaryReport.xdo + parameters


Lets break up the URL again and deal with the parts individually:


  • server:port  - are provided via a parameter that you can have your template subscribe to - CURRENT_SERVER_URL, in the URL dialog we are going to enter {$CURRENT_SERVER_URL} The curly braces tell the parser that it needs to evaluate this value, the $ sign denotes that it is a parameter value. So that takes care of the first part.
  • xmlpserver - this is provided as part of the CURRENT_SERVER_URL parameter.
  • ReportDirectory - this is where you need some knowledge about where the report is that you want to drill to. XMLP does not currently support a relative path nor a report id which would make life easier if you need to move reports around in the directory structure. So for now you are going to have to keep track of the target report and its directory.
  • ReportName.xdo - this is the report you want to run from the link
  • Parameters - this is the most useful bit here we are going to make the URL depend on what the using is currently hovering over. We'll deal with them in a second.

So without the parameters we would have:
 {$CURRENT_SERVER_URL}/Private/SalaryReport/SalaryReport.xdo


for the parameters lets assume we have a parameter called 'dept' and 'emp' and based on the data the user is hovering over we want to pass those values to this report. Lets assume the XML element names for each are DEPT_ID and EMP_ID. We can add the following to the URL to read the two values:
    ?dept={DEPT_ID}&emp={EMP_ID}
Notice the curly braces again forcing the parser to evaluate the values. What really cool is that DEPT_ID and EMP_ID do not have to be in the template layout, so the user can hover over say a department name value and the DEPT_ID value is evaluated and passed.


So the full URL is going to be :
{$CURRENT_SERVER_URL}/Private/SalaryReport/SalaryReport.xdo?dept={DEPT_ID}&emp={EMP_ID}

Of course all the other parameter values we discussed yesterday can be added too ie template and output format.


Now we have the URL we can type it into the dialog, dont worry if your '{}' turn into %7b  and and %7d thats Word encoding the values, annoying but they will be evaluted correctly at runtime.
The only thing we need to add to the template is to declare that we are interested in the CURRENT_SERVER_URL parameter ... the value will be passed by the server all the time but if we do not declare our interest then we're going to get an error. So we create a formfield with the following contents:
<xsl:param name="CURRENT_SERVER_URL"  xdofo:ctx="begin"/>
Of course if you have other report parameters that you want to use in the URL or template itself just declare them in a similar way and they can be used just like the CURRENT_SERVER_URL one i.e. {$PARAMETER}.


If you want to see all of this in action then download and install XMLP with the sample reports, and get to the Home > Executive > Sales Dashboard and check out the 'Sales by Custome' table and float over the customer names, you'll see the URL changing as you hover.


Happy Templating!
 

Comments:

Tim Could you advise how dynamic URL's are implemented within the EBS version of BIP? We have a requirement to produce drill down reports within OAF screens and this looks like the way to go. Any advice would be appreciated. Thanks, Dave

Posted by David Barnes on May 26, 2009 at 11:48 PM MDT #

I wanted to use a grandparent of the current node. If I put something like in the template, I get the text I want displayed. However if I have to this ot build the URL: &p={../../CAN} then I get an errro because it does no like the ../../.

Posted by Jim O'Connor on December 09, 2009 at 04:56 AM MST #

Hi Tim, Can you please provide tag to pass Default data source either as parameter while calling report through URL or as LOV in BI Publisher Enterprise parameters section. Thanks, Swathi

Posted by Swathi on June 02, 2010 at 02:11 AM MDT #

Tanks for tuto, I tried it but i have some problem. For et firt step i'm able to send parameter from a page1 to a page 2, but when i want to send the same parameter to Page3, The parameter come on Page3 without value. Please some body tell me some thing about.

Posted by Kouassi on July 03, 2010 at 04:30 AM MDT #

- Kris

Posted by Ultra ugg on October 17, 2010 at 07:18 PM MDT #

Hey admin, I have a tiny request. I was just googleing for some info on this topic you wrote and found this blog. Some really great stuff you shared here, can I please link to this post on my new website I’m currently working on? It would be great :) . I will check back again later to see how you responded. cheers, Nina Wilson

Posted by whey protein powder on October 24, 2010 at 08:20 PM MDT #

Hi Tim,
My requirement is to produce the dynamic url by peoplecode and used it in the template. Can you plz help me on this.

Thanks in advance

Posted by guest on October 25, 2012 at 03:35 AM MDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today