You use the toolbox to add graphic and textual elements, such as images, circles, squares, lines, dynamic fields, charts, and subreports, to report bands.
The basic technique for adding toolbox elements is to click in the toolbox element and then drag to define an area in the appropriate report band. For some toolbox elements, such as image and text box, a dialog box immediately appears, prompting for more information. For all toolbox elements, you customize the appearance of the element by using the Properties sheet.
You can add toolbox elements from the Insert menu.
For information on charts, see Using charts. For information on subreports, see Using subreports.
Create a text box
- Click the Label icon (abc) in the toolbox.
- Define the area for the label by dragging on the desired band.
- Enter the label text in the Edit Label Text dialog box. To add a line break, press Control+Enter.
- Click OK, or press Enter.
Note: ColdFusion trims leading and trailing blanks from labels. To include leading and trailing blanks, define a dynamic field and include the blanks in the expression, for example, " My Title ".
Import image files
- Click the Image icon in the toolbox.
- Define the area for the image by dragging on the desired band.
- In the Image File Name dialog box, navigate to the file that contains the image, select the file, and click OK.
Use a database BLOB column as an image source
- Click the image icon in the toolbox (the icon has a tree on it).
- Define the area for the image by dragging on the desired band.
The Image File Name dialog box appears.
You can also drag the BLOB field from the Fields and Parameters tab to a report band.
- Click Cancel.
The Expression Builder appears.
- Click the Image Type pop-up menu and change File/URL to BLOB.
- Select the query field or input parameter that contains the BLOB column.
Note: The BLOB column must contain a binary image in GIF, JPEG, or PNG format.
- Click OK.
Note: These instructions assume that the contents of the BLOB column can be rendered as an image.
Add rectangles, ellipses, and lines
- Click the rectangle, ellipses, or line icon in the toolbox.
- Define the area or line by dragging on the desired band.
- Resize the selected element by dragging the handles that surround it.
Pressing the Control key while resizing a rectangle, ellipsis, or line, constrains the element to a square, circle, or angles that are multiples of 45 degrees.
Add dynamic fields
- Click the Field icon in the toolbox.
- Define the area for the dynamic field by dragging on the desired band.
The Add Field dialog box appears (if you haven't defined any query fields, the Expression Builder appears).
- Select the field to add. If you select a query field, calculated field, or input parameter, this is the same as dragging from the Fields and Parameters tab.
- (Optional) Select Manually Entered Expression.
The Expression Builder appears. This option is useful for calculations that use variables in the same row. For example, to compute total price for an order detail line item, you might use the following expression:
LSNumberFormat((query.unitprice * query.quantity), ",_.__")
- Click OK.