coolscitist
coolscitist

Reputation: 3377

Show different header on first page of RTF template (BI publisher)

I came across a problem while creating RTF template for BI publisher. I am displaying a table in the header (not an MS word header but header identified as something above start:body tag) of an RTF template. That table has 3 rows, I need to display one of those rows only in the first page and not in other pages.

I did not find any method on querying for the page number. So, I used a flag in the following manner: (Here, suffix _f denotes RTF field). The following is what my RTF file looks like:

+---------------------------------------------------------------------------------+
¦ init_f ¦    Row to be shown on all the pages     ¦                              ¦
¦--------+-----------------------------------------+------------------------------¦
¦ if_f   ¦ Row to be shown on the first page only. ¦   end_if_f change_variable_f ¦
+---------------------------------------------------------------------------------+

<?start:body?>

other stuff

<?end body?>

Where,

init_f

<?if: (xdoxslt:get_variable($_XDOCTX,'FLAG')!='NONFIRST')?><?xdoxslt:set_variable($_XDOCTX,'FLAG','FIRST')?><?end if?>

if_f

<?if: (xdoxslt:get_variable($_XDOCTX,'FLAG'))='FIRST'?>

end_if_f

<?end if?>

change_variable_f

<?xdoxslt:set_variable($_XDOCTX,'FLAG','NONFIRST')?>

BUT, I still see all the rows in all the pages. It seems like the value of variable 'FLAG' is not preserved between different pages. To me, it seems like, header is generated once and same header is used in all the pages. What is the solution?

Upvotes: 0

Views: 14278

Answers (1)

GELR
GELR

Reputation: 1293

Create different template and call them as follow

<?call-template:tHEADER_VERSO?>
<?start:body?>
<?call-template:tHEADER_RECTO?>
<?for-each@section:XMLELEMENT?>
<?call-template:tDETAILS?>
<?end for-each?>
<?end body?>
<?call-template:tFOOTER?>

To define a template

<?template:tDetail?>
  text content
<?end template?>

Upvotes: 0

Related Questions