Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cfdocument

New Here ,
Oct 14, 2009 Oct 14, 2009

I am having a heck of a time trying to work with page breaks using <cfdocument>. I have a query that I loop over and it generates some html <table> with data from the query in the html <td>'s. The problem is the page just breaks off and continues on the next page, it essentially just cuts my table wherever the page break occurs.

I have tried css, adjusting the margins,  cfdocumentitem pagebreak, etc...to no avail.

I am using version  8,0,0,176276

Any suggestion would be greatly appreciated.

1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Oct 14, 2009 Oct 14, 2009

Hey There,

Try something like this:

Repeat additional page code below to cover the query output. You can

add enough additional page code to account for future output data. Like

if current output requires 5 pages, you could code for 8 pages, giving you

a 3 page buffer before having to add more additional page code.

Leonard B

<=== Code below ===>

<cfdocument>

<table>
<tbody>
<cfoutput query="qname" maxrows="[enter max rows to display per page]" startrow="1">
<tr>
    <td>
    <!---  Insert output --->
    </td>
<

...
Translate
Engaged ,
Oct 14, 2009 Oct 14, 2009

Hey There,

Try something like this:

Repeat additional page code below to cover the query output. You can

add enough additional page code to account for future output data. Like

if current output requires 5 pages, you could code for 8 pages, giving you

a 3 page buffer before having to add more additional page code.

Leonard B

<=== Code below ===>

<cfdocument>

<table>
<tbody>
<cfoutput query="qname" maxrows="[enter max rows to display per page]" startrow="1">
<tr>
    <td>
    <!---  Insert output --->
    </td>
</tr>
</cfoutput>
</tbody>
</table>

<!--- Additional page (2) --->

<cfif qname.recordcount gt 25>
<cfdocumentitem type="pagebreak" />

<table>
<tbody>
<cfoutput query="qname" maxrows="[enter max rows to display per page]" startrow="[enter start row for page]">
<tr>
    <td>
    <!---  Insert output --->
    </td>
</tr>
</cfoutput>
</tbody>
</table>

</cfif>

<!--- Additional page (3) --->

<cfif qname.recordcount gt 50>
<cfdocumentitem type="pagebreak" />

<table>
<tbody>
<cfoutput query="qname" maxrows="[enter max rows to display per page]" startrow="[enter start row for page]">
<tr>
     <td>
     <!---  Insert output --->
     </td>
</tr>
</cfoutput>
</tbody>
</table>

</cfif>

</cfdocument>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 15, 2009 Oct 15, 2009

Thank you for responding so quickly. I did what you suggested, but the pagebreak is not working as intended, instead it creates a gap (about 3 lines) between output queries.

Thanks...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 15, 2009 Oct 15, 2009
LATEST

Mystery solved...I enclosed the output query in cfdocumentsection

& the pagebreak is now working.

Thanks again!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources