cfreport

Description

Used to do either of the following:

Categories

Related

History

ColdFusion 8: Added the style and resourceTimespan attributes. Added the HTML and XML values to the format attribute. ColdFusion MX 7.0.1: Added the RTF value to the format attribute, to let you generate reports in RTF format. ColdFusion MX 7: Added support for the ColdFusion Report Builder. ColdFusion MX: Changed data source connection behavior: Crystal Reports now establishes an independent connection to the data source. The connection is not subject to any ColdFusion data source-specific restrictions. For example, the Crystal Reports server can access a data source, regardless of whether it is disabled in the ColdFusion Administrator.

Syntax

ColdFusion Report Builder syntax: 
<cfreport 
    format = "PDF|FlashPaper|Excel|RTF|HTML|XML" 
    template = "absolute pathname or pathname relative to the report file" 
    encryption = "128-bit|40-bit|none" 
    filename = "output filename" 
    name = "ColdFusion variable" 
    ownerpassword = "password" 
    overwrite = "no|yes" 
    permissions = "permission list" 
    query = "query variable" 
    resourceTimespan = #CreateTimeSpan (days, hours, minutes, seconds)# 
    style = "CSS style definition or css file pathname" 
    userpassword = "password"> 
    <cfreportparam ...> 
</cfreport> 
 
Crystal Reports syntax: 
<cfreport 
    report = "report path" 
    dataSource = "data source name"  
    formula = "formula" 
    orderBy = "result order" 
    password = "password" 
    timeout = "number of seconds"  
    type = "standard|netscape|microsoft"  
    username = "username"> 
</cfreport>
Note: You can specify this tag's attributes in an attributeCollection attribute whose value is a structure. Specify the structure name in the attributeCollection attribute and use the tag’s attribute names as structure keys.

Attributes

AttributeDescriptionRequiredDefault
datasourceCrystal Reports
encryptionReport Builder
filenameReport Builder
formatReport Builder
formulaCrystal Reports
nameReport Builder
orderByCrystal Reports
overwriteReport Builder
ownerPasswordReport Builder
passwordCrystal Reports
permissionsReport Builder
queryReport Builder
reportCrystal Reports
resourceTimespanReport Builder
styleReport Builder
templateReport Builder
timeoutCrystal Reports
typeCrystal Reports
userNameCrystal Reports
userPasswordReport Builder

Usage

Use this tag to generate a report using a report definition created in either ColdFusion Report Builder or in Crystal Reports. (For more information on using the ColdFusion Report Builder, display the online help by opening the Report Builder and pressing F1.)
Note: The Excel report output format type provides limited support for the formatting options available in ColdFusion Reporting. Images and charts are not supported and numeric data containing formatting (commas, percents, currency, and so on) appear as plain text in Excel. The Excel output format supports simple reports only and Adobe recommends that you give careful design and layout consideration to reports designed for Excel output.
This tag requires an end tag.

Example

Example 1: This example shows the use of cfreport for the ColdFusion Report Builder.
<cfquery name="northwindemployees" datasource="localnorthwind"> 
    SELECT EmployeeID, LastName, FirstName, Title, City, Region, Country 
    FROM Employees 
    ORDER BY Country, City 
</cfquery> 
 
<CFREPORT format="PDF" template="FifthReport.cfr"  
    query="#northwindemployees#"/> 
Example 2: This view-only example shows the use of cfreport for Crystal Reports.
<h3>cfreport Tag<h3> 
cfreport lets reports from the Crystal Reports Professional report writer display through a ColdFusion interface. To run, the tag requires the name of the report. cfreport can also pass information to the report file displayed, to change the output conditions.</p> 
This example would run a report called "monthlysales.rpt " and pass it an 
    optional filter condition to show only the information for a subset  
    of the report.</p> 
 
<cfreport report = '/reports/monthlysales.rpt'> 
    {Departments.Department} = 'International' 
</cfreport> 
 
Substitute your report files and filters for this code. cfreport can put Crystal Reports into web pages.</p>