Skip to main content
December 17, 2010
Question

How to get result query to print PDF pages, e.g.invoices?

  • December 17, 2010
  • 2 replies
  • 574 views

Greetings

I have set up the query results to fill an html page with data which is an invoice to be sent out to lesees.

Using the cfdocument tag, I can get a printable PDF version with the mailing address positioned to show in a window envelope, etc., but only one at a time.

There is a way to loop through all the records (in this case, over 1000) and print out the whole lot (single page invoices in PDF) with one command, I assume?

I have looked into cfprint and cfreport, but don't see how these could be used in this situation?

Thanks for any help with this...

This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
December 18, 2010

Copy all 1000 invoces as one PDF document, then print. Something like this

<cfdocument format="PDF" name="invoices">
<html>
<cfloop through query or array or list, and so on, to get each address>
<!--- Text containing a dynamically generated address goes here --->
</cfloop>
<!--- Starts a new page for each pass of the loop --->
<cfdocumentitem type="pagebreak" />
</html>
</cfdocument>

<cfprint source="invoices" printer="\\s1001prn02\NTN-2W-HP_BW02">

Inspiring
December 18, 2010

The simplest idea that pops into my head is:

<cfloop>

<cfdocument>

<cfprint>

closing tags

I've neber actually tried this.  What happened when you did?