Using toolbox elements on report bands

You can use the toolbox to add graphic and textual elements, such as images, circles, squares, lines, dynamic fields, charts, and subreports, to report bands.

This section discusses text, images, circles, squares, lines, and dynamic fields. For information on charts, see Using charts. For information on subreports, see Using subreports.

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 can customize the appearance of the element using the Properties sheet.

Tip: You can add toolbox elements through the Insert menu.

To use text boxes:

  1. Click the Label icon (abc) in the toolbox.
  2. Define the area for the label by dragging on the desired band.

    The Edit Label Text dialog box appears.

  3. Enter the label text. To add a line break, press Control+Enter.
  4. 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    ".

To use image files:

  1. Click the Image icon in the toolbox.
  2. Define the area for the image by dragging on the desired band.

    The Image File Name dialog box appears.

  3. Navigate to the file containing the image, select the file, and click OK.

To use a database BLOB column as an image source:

  1. Click the Image icon in the toolbox.
  2. Define the area for the image by dragging on the desired band.

    The Image File Name dialog box appears.

    Tip: You can also drag the BLOB field from the Fields and Parameters tab to a report band.

  3. Click Cancel.

    The Expression Builder appears.

  4. Click the Image Type drop-down list box and change File/URL to BLOB.
  5. 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.

  6. Click OK.

Note: These instructions assume that the contents of the BLOB column can be rendered as an image.

To use rectangles, ellipses, and lines:

  1. Click the rectangle, ellipses, or line icon in the toolbox.
  2. Define the area or line by dragging on the desired band.
  3. (Optional) Resize the selected element by dragging the handles that surround it.

    Tip: 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.

To use dynamic fields:

  1. Click the Field icon in the toolbox.
  2. 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).

  3. 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.
  4. (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), ",_.__")
    
  5. Click OK.

View comments in LiveDocs