2 Replies Latest reply: Sep 24, 2013 4:01 AM by Patrick S RSS

    Using Current Page Number in IF Condition

    Patrick S

      Hi there,

       

      I have a requirement to insert a blank page if the last page number in the group is odd so i'm trying to use the below syntax but its not working:

       

      <?if:page-number mod 2 != 0?>

      <xsl:attribute name="break-after">page</xsl:attribute>

      <?end if?>

       

      The number of pages in my report is 5, and If I put 5 instead of page-number in the above code, the blank page gets inserted, but it seems that page-number is not getting recognized in the IF condition, and if I put <?fo:page-number?> instead of page-number in the if condition, I get an error.

       

      How can I write an if condition based on the current page number?

       

      Thanks,

      Patrick

        • 1. Re: Using Current Page Number in IF Condition
          Ragul Halan

          Try using the below command


          Have a condition before you group


          even-skip-page-count F

          Empno

          Ename

          F EMPNO

          ENAME E

            E

           

          even-skip-page-count ---> contains  <?section:force-page-count;'end-on-even-layout'?>


          When you want to handle the suppression of the even pages from the total number of pages


          you can use the following command within the even-skip-page-count form field --> <?section:xdofo:blank-on;'even-skip-page-count'?>


          Thanks


          If this helps you then please mark the answer as "correct" or else "helpful"

          • 2. Re: Using Current Page Number in IF Condition
            Patrick S

            Thanks for your answer, I tried it but it didnt give the desired output, I have many groups in my RTF and I want the condition to apply on the one of the detail groups since the page number resets everytime once the master record changes.

             

            My solution works only if I can include the page number in the IF condition, is there any way to do that?

             

            Thanks,

            Patrick