Renu Deshpande 0 Newbie Poster

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.