I have a member directory where I'm using CFDocument to create a PDF. The
query results are outputted using a cfloop around a table. Problem is,
right now, I can only output one record per page before the
<cfdocumentitem="pagebreak"> occurs. If I remove the "pagebreak", there
will be 3 or 4 member records, and a member record can break across two
pages, which doesn't look right.
Is there a way to force the cfloop to loop (2) records per page, then insert
the pagebreak, then loop two more records on the next page, and so on?
Here's an example of the printout (one record per page)
www.nsaohio.com/directory/
/////Code/////
<cfdocument
format="pdf"
filename="#APPLICATION.downloadFiles#nsaohio_ProMember_Directory.pdf"
overwrite="yes"
pagetype="letter"
margintop="1"
marginright="1"
marginbottom="1"
marginleft="1.5">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<cfoutput>
<link rel="stylesheet" href="#SESSION.css.screen#" type="text/css"
media="screen" />
<link rel="stylesheet" href="#SESSION.css.print#" type="text/css"
media="print" />
</cfoutput>
</head>
<body>
<cfdocumentitem type="header">
<br />
<br />
<div style="font:normal bold 18px Tahoma; color:black;
text-align:center; text-decoration:underline;">NSA Ohio Professional Member
Directory</div>
</cfdocumentitem>
<cfloop query="qSpeakerList">
<cfoutput>
<table border="0" cellspacing="0" cellpadding="2" width="100%"
class="borderAllSides" align="center">
... Other table content here ...
<tr><td colspan="3" class="text12left" style="padding:0 6px
6px 6px;">#memberProfile# </td></tr>
</table>
<br />
</cfoutput>
<cfdocumentitem type="pagebreak" />
</cfloop>
<cfdocumentitem type="footer">
<br />
<cfoutput>
<div style="font:normal normal 16px Tahoma; color:black;
text-align:center;">
#DateFormat(Now(), 'DDDD, MMMM DD,
YYYY')# &##8212; Page #cfdocument.currentpagenumber# of
#cfdocument.totalpagecount#
</div>
</cfoutput>
</cfdocumentitem>
</body>
</html>
</cfdocument>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265610
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4