Accessibility

Table of Contents

Printing Avery Labels with the ColdFusion MX 7 Report Builder

Building an Avery 5160 Label Report

In the following section, I will go step by step through creating a new report for the Avery 5160 label. You can apply the same steps when creating any size Avery label template. You can substitute the label dimensions of your choice but if you plan to use this report with the sample files, please use the Avery 5160 dimensions as described below.

Creating a new report:

  1. Open the ColdFusion Report Builder.
  2. Create a New Report Document. Select the "As a Blank Report" option.

Setting the Page and Label Properties:

  1. By default, the Report Builder shows all of the report sections: Report Header, Column Header, Detail, Column Footer, and Report Footer. In the Properties pane, change the Height to 0 in for the Report Header, Column Header, Column Footer, and Report Footer. You will not need these sections.
  2. Select NewColdFusionReport from the Elements pop-up menu and click the plus (+) on the panel to expand the Column properties.
  3. Set the Column Count to 3.
  4. Set Column Spacing to .15625 in.
  5. Set the bottom margin to .5 in.
  6. Set the left margin to .1875 in.

    Note: Report Builder automatically changes this number to .1944 in. I explain this further below.

  7. Set the page height to 11 in.
  8. Set the page width to 8.5 in.
  9. Set the right margin to .1875 in.

    Note: Report Builder automatically changes this number to .1944 in.

  10. Set the default output format to PDF.
  11. Click the Details section of the report.
  12. In the Properties panel, set the Split Allowed attribute to False.
  13. Set the Height to 1 in. I explain how to finish the report after explaining some of the property settings above.
Report Properties (edited fields highlighted in green)

Figure 1. Report Properties (edited fields highlighted in green)

Details / Label Properties (edited fields highlighted in green)

Figure 2. Details / Label Properties (edited fields highlighted in green)

Before proceeding I would like to answer a couple questions you might be having. In steps 5 and 8, Report Builder automatically rounded the values to a set number. From my experience, I have found that the value will never be rounded more than 1/100th of an inch. This amount is unnoticeable to the human eye, and does not cause any problems during label printing. The only time this may pose a problem is if the height of the label is rounded to a larger number. As you will see in the avery_5162.cfr template, the Report Builder rounds the height of the label entered, 1.33 in, to 1.3333 in. The extra amount, .0033 inches, added to each label causes the Report Builder to think it does not have enough room to insert the last label of the column. Thus, the Report Builder bumps the label to the next column, leaving you with one less label per column. To avoid this issue. decrease the size of the bottom page margin slightly. This does not have a negative visible effect when printing, but allows Report Builder to add the final label to the column.

Why did I use the PDF output format instead of Flash Paper? After many hours of testing I was only able to print the labels accurately using PDF format. The majority of printers (excluding borderless photo printers) cannot print to the absolute edge of the paper. This area, called the “printable area size,” is determined by the printer’s mechanical limitations. When printing in Flash Paper, the page is automatically shrunk to fit within the printer’s printable area size. This makes the entire page 1-3 percent smaller, which, in turn, incorrectly offsets your label measurements. While this may be less of an issue for larger labels, you won’t be able to accurately print the smaller label sizes (Avery 5167). When you print from Adobe Acrobat Reader, you are given options that make it possible to print the entire page at 100 percent.

Finishing the report:

The steps below assume that you created the CFR (report) file for use with the sample database and ColdFusion templates provided with this article. The sample CFML page passes the query to the report, so I do not explain how to add a query directly to the CFR file. If you are not using the sample files, you must add a query and fields to the report before it will function correctly.

  • Under the 'Field and Parameters' tab right-click Query Fields and press Add Query Field.
  • Enter the value street in the name input box. Press OK.
  • Drag the field you created to the Details section of the report.
  • Repeat steps 1-3 for the name, city, state, and zip fields.
  • Save the report as avery_5160.cfr.
  • Place the CFR file in your webroot.

    Note: Below, I explain how to use this CFR file, and for demonstration purposes, provide a solution version of the avery_5160.cfr file that you will save over the version you have created in these steps.

You have just created your first report with the ColdFusion Report Builder. I have included the report you have just created and other reports (these have the extension of CFR) in the sample download you in the Requirements section of the article. Although I have provided sample reports for several of the Avery label sizes, you could create numerous other reports, each with their own formats, through the ColdFusion Report Builder. Just so you can see how you use the CFR files, however, in the following section, you’ll create mailing labels using my sample reports.