| | |
How to access cfdocument.currentpagenumber outside the cfdocumentitem tag
Please support our ColdFusion advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2009
Posts: 3
Reputation:
Solved Threads: 0
Hi all
Can anybody help me with this.
I want to access cfdocument.currentpagenumber outside the cfdocumentitem tag. I tried the following ways :
1)
Output :
Variable PAGE is undefined.
At Line : <td> Page No : #Page#</td>
2)
Output :
No Error on PDF , but value of Page is blank. I do not get the value of cfdocument.currentpagenumber in Page.
3)
Output : ERROR :
Variable HDNPAGE is undefined.
at line : <td> Page No : #hdnPage#</td>
Thanks in advance.
Can anybody help me with this.
I want to access cfdocument.currentpagenumber outside the cfdocumentitem tag. I tried the following ways :
1)
coldfusion Syntax (Toggle Plain Text)
<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)
coldfusion Syntax (Toggle Plain Text)
<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)
coldfusion Syntax (Toggle Plain Text)
<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>
Variable HDNPAGE is undefined.
at line : <td> Page No : #hdnPage#</td>
Thanks in advance.
Last edited by peter_budo; Aug 3rd, 2009 at 12:38 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
![]() |
Similar Threads
- Pagination (JavaScript / DHTML / AJAX)
- Access a tag inside Iframe. Need Help (JavaScript / DHTML / AJAX)
- Creating a submission system (PHP)
- the title attribute of the SELECT tag is not supported???? (ASP)
- Exciters VS Access Points (Networking Hardware Configuration)
- Preventing copies being made using access and VB (Visual Basic 4 / 5 / 6)
- About <error-page> tag in struts (JSP)
- linking to ms access (C++)
- Access unqualified XML element (C#)
Other Threads in the ColdFusion Forum
| Thread Tools | Search this Thread |





