Adobe COLDFUSION 9 Manual page 1014

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
Creating basic reports from HTML and CFML
You can convert HTML-based reports into PDF or FlashPaper output by wrapping the HTML in the
and end tags, and specifying
• Page size
• Page orientation
• Margins
• Encryption (PDF only)
• User password and owner password (PDF only)
• Permissions (PDF only)
For complete information on these options, see the cfdocument tag discussion in the 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
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>
Creating sections, headers, and footers
You can use the cfdocument and cfdocumentsection tags to fine-tune your printable output, as follows:
: Creates page breaks, headers, or footers.
cfdocumentitem
: Divides output into sections, optionally specifying custom margins. Within a section, use the
cfdocumentsection
tag to specify unique headers and footers for each section. Each document section starts on a new page.
cfdocumentitem
The cfdocumentitem tag
You use one or more
cfdocumentitem
tags with or without the
cfdocumentitem
• With
cfdocumentsection
specified headers and footers.
• Without
cfdocumentsection
• If the tag is at the top of the document, it applies to the entire document.
• If the tag is in the middle of the document, it applies to the rest of the document.
• If the tag is at the end of the document, it has no affect.
You can use the
cfdocumentitem
shows:
attributes, as appropriate, to customize the following items:
cfdocument
tags to specify headers and footers or to create a page break. You can use
cfdocumentsection
: The
attribute applies only to the section, and overrides previously
cfdocumentitem
: The
cfdocumentitem
tag to create a running header for an entire document, as the following example
Last updated 8/5/2010
"Creating a simple
report" on page 1036.
tag, as follows:
attribute applies to the entire document, as follows:
1009
start
cfdocument

Advertisement

Table of Contents
loading

Table of Contents