Whatever message this page gives is out now! Go check it out!
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>| Attribute | Applies to | Req/Opt | Default | Description | ||||
datasource | Crystal Reports | Optional | Name of registered or native data source. | |||||
encryption | Report Builder | Optional | none | (format="PDF" only) Type of encryption for the report output. Valid values are:
| ||||
filename | Report Builder | Optional | Filename to contain the report. You cannot specify both the name and filename attributes. The filename extension must match the value of the format attribute. If you write report output to an HTML file, ColdFusion automatically creates a directory relative to the output file in the format filename_files. Also, it generates PNG files for any charts in the report and copies of any image files imported into the report and stores them in this directory. | |||||
format | Report Builder | Required | Format of the report output:
| |||||
formula | Crystal Reports | Optional | One or more named formulas. Terminate each formula with a semicolon. Use the format:
If you use a semicolon in a formula, escape it by typing it twice (\;;). For example:
| formula = "formulaname1 = 'formula1';formulaname2 = 'formula2';" | formula = "Name1 = 'Val_1a;;Val_1b';Name2 = 'Val2';" | |||
name | Report Builder | Optional | Name of the ColdFusion variable that contains the report output. You cannot specify both name and filename. This attribute is not valid when format="HTML". | |||||
orderBy | Crystal Reports | Optional | Orders results according to your specifications. | |||||
overwrite | Report Builder | Optional | no | Specifies whether to overwrite files that have the same name as that specified in the filename attribute:
| ||||
owner Password | Report Builder | Optional | (format="PDF" only) Owner password for the report, | |||||
password | Crystal Reports | Optional | Password that corresponds to username required for database access. Overrides default settings for data source in the ColdFusion Administrator. | |||||
permissions | Report Builder | Optional | (format="PDF" only) Specifies one or more of the following permissions:
| |||||
query | Report Builder | Optional | Name of the query that contains input data for the report. This query overrides the query in the Report Builder report. The ColdFusion query must contain at least all of the columns included in the Report Builder query; however, the WHERE clause can differ. If you omit this parameter, Report Builder uses the data from the internal SQL statement or from cfreportparam items. | |||||
report | Crystal Reports | Required | Report pathname. Store Crystal Reports files in the same directories as ColdFusion page files. | |||||
resource Timespan | Report Builder | Optional | 5 minutes | (format="HTML" only) Life span of the resource directory. When you export a Report Builder report in HTML format, ColdFusion writes any images or other resource files in the report to a temporary resource directory. Use this attribute to determine when the resource directory is deleted. For the value, use the CreateTimeSpan function and specify the time span in days, hours, minutes, and seconds, separated by commas; for example, to delete the resource directory after one hour, specify: #CreateTimeSpan(0,1,0,0)#}}If the value is set to 0, the resource directory persists until the next server restart.ColdFusion deletes the resource directory only when {{format="HTML" and neither the name nor filename attribute is specified. The default setting is 5 minutes: #CreateTimeSpan(0,0,5,0)# | ||||
style | Report Builder | Optional | Style in CSS format that overrides a style defined in the Report Builder report at run time. You can specify an absolute file path, a file path relative to the report, or a string in valid CSS format. For the styles to take effect, the style names must match Style Name attributes assigned to elements in the Report Builder report. You can generate a CSS file in Report Builder and export it or you can create a CSS file with a text editor. For a list of supported CSS styles, see the section Style properties. | |||||
template | Report Builder | Required | Specifies the pathname to the Report Builder (CFR) file, relative to the web root. | |||||
timeout | Crystal Reports | Optional | Specifies the maximum time, in seconds, in which a connection must be made to a Crystal Reports file. | |||||
type | Crystal Reports | Optional | standard | Type of report:
| ||||
userName | Crystal Reports | Optional | Username required for entry into a database from which the report is created. Overrides default settings for data source in ColdFusion Administrator. | |||||
user Password | Report Builder | Optional | (format="PDF" only) User password. |
<cfreport template="myreport.cfr" style="mystyle.css" format="PDF">
<cfreportParam subreport="subreport1" style="subreport1-style.css">
<cfreportParam subreport="subreport2" style="subreport2-style.css">
</cfreport><cfreport template="myreport.cfr" style='mystyle { defaultStyle: true; font-family:"Comic Sans MS"; color: ##00FF00; }' format="FlashPaper">
</cfreport><cfset mystyle='mystyle { defaultStyle: false; font-family: "Comic Sans MS"; }'>
<cfreport template="myreport.cfr" style="#mystyle#" format="HTML">
</cfreport>DefaultStyle
{
default-style: true;
color: black;
font-family: Arial, "Comic Sans MS";
font-size: 16;
text-decoration: underline;
}PurpleBoldItalicText
{
color: purple;
font: italic bold 20px 30px Arial;
}| Property name | Report Builder only | Valid values | Description |
background-color | No | See the section Valid color values | Background color of the specified report element, if the element is not transparent. The default background color is white. |
border | No | border-width border-style border-color | A shorthand property that specifies the border-width, border-style, and border-color properties for all of the borders in an element. |
border-color | No | See the section Valid color values | Border color for text, images, and charts. You can customize each side of the border. The default color is white. |
border-style | No | solid dashed none | A shorthand property that specifies the border-top-style, border-right-style, border-bottom-style, and border-left-style (the comma-separated values must be in this order). If one or more values are not specified, the value for the opposite side is used. If only one value is listed, that value applies to all sides. The none value overrides the border-width value. Any other values, including hidden, dotted, groove, ridge, inset, outset, and double, are displayed as solid. |
border-top-colorborder-left-colorborder-bottom-colorborder-right-color | No | See the section Valid color values | Color of the element's top, left, bottom, and right border. For more details see that section Border and margin styles. If no border-color property is specified, the value of the color property is used instead. |
border-top-styleborder-left-styleborder-bottom-styleborder-right-style | No | solid dashed | Line style of the element's top, left, bottom, and right border. For more details see the section Border and margin styles.Any value other than dashed displays as solid. |
border-top-widthborder-left-widthborder-bottom-widthborder-right-width | No | thin medium thick 1px 2px 4px | Thickness of the top, left, bottom, and right border of an element. Negative values are not valid. For more details see the section Border and margin styles:
|
border-width | No | thin medium thick 1px 2px 4px | A shorthand property that specifies the border-top-width, border-right-width, and border-bottom-width properties with a single property and value notation (the comma-separated values must be in this order). If one or more values are not specified, the value for the opposite side is used. If only one value is listed, it applies to all sides:
|
clip | No | auto stretch ratio | Specifies how images are resized:
|
color | No | See the section Valid color values | Color of the text (in text elements) and the border (in graphic elements). The default color is black. |
corner-radius | Yes | integer | Radius for arcs used to draw the corner of rectangles. The default is 0 (square corners). Values less than 0 are interpreted as 0. |
default-style | Yes | true false | Default style for elements that do not or cannot have a style applied. A subreport inherits its parent's default-style if it does not have one of its own. |
embed-pdf-font | Yes | true false | Specifies whether fonts are embedded in the PDF document. Embedded fonts insure that the fonts display properly even if the font is not installed on the system where the report is viewed. |
empty-cells | No | show hide | Shows or hides a null value for text expressions:
|
font | No | font-style font-weight font-size line-height font-family | Font characteristic specifications. Use this as a shorthand to specifying multiple property values; for example:font: italic 20px Arial;Default values for this property match those used for the individual properties. Default values for the individual properties are applied to the values omitted from the font property. |
font-family | No | Comma-separated list of font names. | Group of fonts to apply to the element. The first font found in the list is applied to the element. The default is:font-family: Arial, Helvetica, sansserif;If a font name contains spaces, enclose the name in quotation marks, for example:font-family: Courier, "Courier New", Arial; |
font-size | No | [length] | Font size measured in points or pixels. Negative values are not valid. The default value is 10 points. You can specify points or pixels. 1 pixel = 0.75. points. This property also is a component of the font property.Standard CSS supports other types of values not supported by Report Builder. |
font-style | No | normal italic oblique | Font style. The italic and oblique values are similar. The default value is normal. Also, this property is a component of the font property. |
font-weight | No | normal bold bolder lighter 100 200 300 400 500 600 700 800 900 | Font weight. Report Builder does not support varying degrees of boldness or lightness; therefore, normal and lighter appear as normal; all other values appear as bold. The default is normal. Also, this property is a component of the font property. |
line-height | No | normal number length percentage | Amount of space between consecutive lines of text:
|
line-size | Yes | none thin 1px 2px 4px dashed | Type of the border around a graphic element or the type and the thickness of line elements. By default, lines and rectangles have a 1-pixel border; thin is 0.05 pixels. |
margin | No | top-integer [right-integer] [bottom-integer] [left-integer] | Amount of blank space within the bounding box of an element. This is a shorthand property that specifies the margin-top, margin-right, margin-bottom, and margin-left properties with a single property and value notation (the values must be in this order separated by commas.) If one or more values are not specified, the value for the opposite side is used. If only one value is listed, it applies to all sides. For more details see the section Border and margin styles.CSS margins are transparent, which reveals the background of the parent element. Negative values are valid; this allows for text overlays.Examples:margin: 10,20,30,40; margin: 10; margin: 10,20,30; |
margin-topmargin-leftmargin-bottommargin-right | No | integer | See margin. |
parent-style | Yes | styleName | Name of the parent report style from which this style inherits some or all of its properties. The style name must be defined in either the report or before this style definition in the CSS file or text. |
text-align | No | left center right justify | Alignment of text and images on the horizontal axis. The default value is left. |
text-decoration | No | underline line-through underline line-through | Text characteristics not defined with the font-style and font-weight properties. The color of the text-decoration is determined by the color property for the element. Unknown values are ignored. |
text-rotation | Yes | none left right | Rotation of text elements. Use it to change the text direction by rotating it 90 degrees to the right or left. |
transparency-mode | Yes | opaque transparent | Transparency of elements. Graphic elements, such as rectangles and lines, are opaque by default, but images are transparent. Subreport elements, static text, and text fields are transparent by default. |
vertical-align | No | top middle bottom | Alignment of text and images on the vertical axis. The default value is top. |
xhtml-formatted-text | Yes | true false | Specifies whether the text element contains XHTML-compatible instructions:
|
color:lime
color:#00FF00
color:#0F0
color:rgb(0,255,0)
color:rgb(0%,50%,0%)<cfreport template="myreport.cfr" style='mystyle { defaultStyle: true;
font-family:"Comic Sans MS"; color: ##00FF00; }' format="HTML"/>| Number of parameters | Example | Result |
1 | border-width: thick | Parameter applied to all four sides of the element's border. |
2 | border-width: thick, thin | First parameter (thick) applied to the top and bottom sides; second parameter (thin) applied to the left and right sides. |
3 | border-width: thick, thin, medium | First parameter (thick) applied to the top; second parameter (thin) applied to the left and right sides; third parameter (medium) applied to the bottom. |
4 | border-width: thick, thin, medium, thick | First parameter (thick) applied to the top; second parameter (thin) applied to the right side; third parameter (medium) applied to the bottom; fourth parameter (thick) applied to the left side. |
<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#"/><h3>cfreport Tag<h3>
<p>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>
<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>
<p>Substitute your report files and filters for this code. cfreport can put Crystal Reports into web pages.</p>