How to access cfdocument.currentpagenumber outside the cfdocumentitem tag

Discussion in 'Programming' started by Renu Deshpande, Aug 2, 2009.

  1. #1
    Hi all

    Can anybody help me with this.

    I want to access cfdocument.currentpagenumber outside the cfdocumentitem tag. I tried the following ways :

    1)



    <cfdocument format="pdf" orientation="landscape" unit="cm" margintop="4.0" marginbottom="2.0" marginleft="2.2" marginright="2.2"
    scale=99 filename="c:\test.pdf" overwrite="yes">

    <cfoutput>
    <cfdocumentsection>
    <cfdocumentitem type="header">
    <cfset Page = cfdocument.currentpagenumber>
    </cfdocumentitem>

    <cfdocumentitem type="footer" >
    FOOTER !!!!
    </cfdocumentitem>

    <table>
    <tr>
    <td>HELLO</td>
    <td> Page No : #Page#</td>
    </tr>
    </table>


    </cfdocumentsection>
    </cfoutput>
    </cfdocument>


    Output :

    Variable PAGE is undefined.

    At Line : <td> Page No : #Page#</td>

    2)

    <cfdocument format="pdf" orientation="landscape" unit="cm" margintop="4.0" marginbottom="2.0" marginleft="2.2" marginright="2.2"
    scale=99 filename="c:\test.pdf" overwrite="yes">

    <cfoutput>
    <cfset Page = "">
    <cfdocumentsection>

    <cfdocumentitem type="header">
    <cfset Page = cfdocument.currentpagenumber>
    </cfdocumentitem>

    <cfdocumentitem type="footer" >
    FOOTER !!!!
    </cfdocumentitem>

    <table>
    <tr>
    <td>HELLO</td>
    <td> Page No : #Page#</td>
    </tr>
    </table>

    </cfdocumentsection>
    </cfoutput>
    </cfdocument>



    Output :

    No Error on PDF , but value of Page is blank. I do not get the value of cfdocument.currentpagenumber in Page.


    3)
    <cfdocument format="pdf" orientation="landscape" unit="cm" margintop="4.0" marginbottom="2.0" marginleft="2.2" marginright="2.2"
    scale=99 filename="c:\test.pdf" overwrite="yes">
    <cfoutput>
    <form>
    <input type="hidden" id="hdnPage" />
    <cfdocumentsection>
    <cfdocumentitem type="header">
    <cfset Page = cfdocument.currentpagenumber>
    </cfdocumentitem>

    <cfdocumentitem type="footer" >
    FOOTER !!!!
    </cfdocumentitem>

    <table>
    <tr>
    <td>HELLO</td>
    <td> Page No : #Page#</td>
    </tr>
    </table>

    </cfdocumentsection>

    </form>
    </cfoutput>
    </cfdocument>
    Output : ERROR :
    Variable HDNPAGE is undefined.
    at line : <td> Page No : #hdnPage#</td>

    Thanks in advance.
     
    Renu Deshpande, Aug 2, 2009 IP
  2. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    As mentioned on one of your other threads

    a) it is not possible to access currentpagenumber outside of the cfdocumentitem tag
    b) it is not possible to repeat the table headers unless you can find a supported css attribute for this

    (Geez. You sure posted your questions to a _lot_ of forums)
     
    cfStarlight, Aug 4, 2009 IP