You can convert HTML-based reports into PDF or FlashPaper output by wrapping the HTML in the cfdocument
start and end tags, and specifying cfdocument
attributes, as appropriate, to customize the following items:
For complete information on these options, see the cfdocument
tag discussion in CFML Reference.
Note: Embedding fonts in the report can help ensure consistent display across multiple browsers and platforms. For more information on the considerations related to embedding fonts, see Font management with printable reports.
The following example displays a list of employees, using a cfoutput tag to loop through the query:
<cfdocument format="flashpaper">
<h1>Employee List</h1> <!--- Inline query used for example purposes only ---> <cfquery name="EmpList" datasource="cfdocexamples"> SELECT FirstName, LastName, Salary, Contract FROM Employee </cfquery> <cfoutput query="EmpList"> #EmpList.FirstName#, #EmpList.LastName#, #LSCurrencyFormat(EmpList.Salary)#, #EmpList.Contract#<br> </cfoutput></cfdocument>