2 Replies Latest reply: Sep 10, 2013 5:40 AM by robikshrestha RSS

    Display different header in the first page

    robikshrestha

      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, text with red color denotes RTF field). The following is what my RTF file looks like:

       

      Header 1Header 2Header 3
      init_fieldThis is the row to be shown on all the pages
      if_fieldThis row should only be shown on the first page.end_if change_variable

      <?start:body?>

      other stuff

      <?end body?>

       

      Where,

       

      init_field

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

       

      if_field

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

       

      end_if

      <?end if?>

       

      change_variable

      <?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