
Printing labels from web-based applications has always been a major issue. If you were using Avery Standard labels, you could accomplish printing them through html formatting or by importing the data into a local program. However, if you tried to print labels in this manner to a thermal label printer, forget about it. In the past, I would have solved this problem by installing third-party enterprise reporting software on the server. Those of you that are familiar with the reporting software that I speak of probably also know of the time and money needed to implement it. When I read an article last year about ColdFusion Blackstone (the code-name for ColdFusion MX 7) and the new Report Builder in it, I quickly joined the beta program and began testing every aspect of its reporting capabilities. After a couple hours of trial and error (okay, maybe more than a couple), I developed the coding and label templates needed to print from my current ColdFusion applications. Needless to say, my client, a small biotech company that needs to print hundreds of labels each day, was very pleased to find out how much time and money the application saved them. This experience gave me the idea for writing this article. While most of you probably don’t have a need for printing a large quantity of labels that withstand temperatures below 70 degrees (as I do for the biotech company I work for), all developers can benefit from a primer on printing to the universally known Avery® standard label.
In this article, I cover the basics of printing Avery labels using the ColdFusion Report Builder. For this article you need to have a basic understanding of creating query-driven reports using ColdFusion MX 7. This article covers the layout creation and printing of Avery labels, but does not cover query-driven data generation, as it has already been covered in previous articles.
To complete this tutorial you will need to install the following software and files:
Download and install the ColdFusion MX Report Builder after you have installed ColdFusion MX 7.
Note: The Report Builder is only available to users on the Windows platform. Server-side processing (using the cfreport tag, for instance) is available on any server platform.
averylabels.zip (ZIP, 31K)
This ZIP file contains the following files: avery_5160.cfr (4kb), avery_5161.cfr (4kb), avery_5162.cfr (4kb), avery_5163.cfr (4kb), avery_5164.cfr (4kb), avery_5167.cfr (4kb), address.mdb (140kb), index.cfm (3kb), act_create_labels.cfm (4kb), readme.txt (1kb).
Steven Carmo is President of Intrenix, LLC, a full-service IT solutions provider. Steven graduated from East Carolina University in 2000 and has been building applications solely in ColdFusion since version 5.0. He has extensive experience developing applications for the biotechnology, automotive, and recruiting industries.