Monday, February 25, 2008

Disappearing Parameters / Top Level Elements in Template after adding @section to BI / XML Publisher Report

A few people have run into this one so worthy of a post.

When you group with a section, you effectively "set" the base level of your XML to the level at which you group'ed. Hmm, better explained with an example.

Let's say your BIP'ing AR Statements and so you have something like this XML (fragment):

  <COMPANY_NAME>Vision Operations (USA)</COMPANY_NAME>

And in your template you "group" and "section" the statement:

<?end for-each?>

And you want to refer to the element <?COMPANY_NAME?> in the Header section, but if you put <?COMPANY_NAME?> then it doesn't appear (is null).

Why? When you section on G_STATEMENT then that becomes the "base" level, so you need to go back up the XML tree to get to your Parameter / Company Name etc.

In this case you'd need to put


in your Header section. I.e. the parent (G_SETUP) of the parent (LIST_G_STATEMENT) of the current group (G_STATEMENT).

Update:Alternatively you can use xpath from the root node, in this case you could use


in your Header section.

PS. Its been a while since I posted. Busy helping a number of people with BIP and other such sexy things. Means I have a good post pipeline though!