ColdFusion Report Builder


Now that your visitors can use Flash forms to submit limiting criteria, they should be able to choose what data they would like to retrieve from your database. You can represent the results of their data requests either numerically or graphically by using the ColdFusion MX 7 Report Engine. Before your visitors can see the report, however, you need to develop a report template that contains a header, footer, and the appropriate data labels and data placeholders.

The tool that Macromedia has developed for building reports is called the ColdFusion Report Builder (see Figure 19.12). This tool doesn't come installed with ColdFusion, but is available on the Macromedia website at http://www.macromedia.com/software/coldfusion/reporting/.

Figure 19.12. The Macromedia ColdFusion Report Builder interface.


Note

At the time of publishing, the Report Builder was available for only the Windows operating system.


Configuring the Report Builder

Before you can begin building your new reports, you need to configure the Report Builder. After you run the Report Builder for the first time, you are asked to indicate what you want your default measurement for page layout to be (see Figure 19.13). Choose the measurement with which you're most comfortable for tasks such as page layout.

Figure 19.13. Select a default measurement.


Next, you need to add a CF Server and indicate where your local web pages are stored (see Figure 19.14).

Figure 19.14. Establishing connectivity.


To add a CF server, simply click the plus sign and complete the details for the server to which you want to connect. Be sure to type the correct RDS username and password to avoid authentication issues (see Figure 19.15).

Figure 19.15. Enter the details for your RDS server.


Tip

To use the Report Builder, you need the ColdFusion server to be running the RDS Security service. If you installed ColdFusion on your local machine, but did not configure RDS, you need to configure it via the ColdFusion Administrator before you can work with the Report Builder application.


Next, type or browse to the local web root and ensure that the website web root field is correct (see Figure 19.16). When the values are correct, move on to the next step and complete the setup wizard.

Figure 19.16. Complete all the fields to establish a connection to your ColdFusion server.


Understanding the Report Layout

After downloading and configuring the Report Builder, you can easily create reports and subreports by using the two wizards that are included in the application:

  • Report Creation Wizard

  • Server Setup Wizard

As you become more and more adept at creating reports, you can skip the wizards and create completely custom reports based on the blank report, your data, and input submitted by the visitor. To give you an introduction to the application, we give you a look at the Report Creation Wizard and its functionality.

The first step in using the wizard to create a report is to develop a SQL query that draws the correct data from the database, creating a recordset that you can use to display in the report. Click the Query Builder button and choose a database, table, and selection criteria for the data that is to be used in the report. The SQL query in Figure 19.17 would retrieve all the records in the Inventory database.

Figure 19.17. Choose a SQL query to retrieve your data.


You can refine your data by using conditional variables to limit the results. For instance, if you had developed a form that allowed visitors to choose the make of a motorcycle they wanted to view, the contents of that form field might be passed as a form value called "Make." The query in Figure 19.18 shows how the SQL query can be limited with this variable.

Figure 19.18. You can further limit the SQL query by using variables.


After you have developed your query, click the Save button to return to the Report Creation Wizard. The wizard now displays the columns you chose to retrieve from the database (see Figure 19.19) and enables you to choose which will actually be visible in the report.

Figure 19.19. Your fields are now available for display in the report.


In the next dialog within the wizard, you can choose how to group the records retrieved by your SQL query (see Figure 19.20). Groupings generally help the reader of the report easily compare the data that is being displayed. For instance, if Retro's Cycles had four Honda Super Hawk motorcycles for sale, you could group the data by Model and the person reviewing the report could easily compare the attributes of the four Super Hawks.

Figure 19.20. Choose how to group the data that is retrieved.


Following through the rest of the wizard, you can customize your report's layout (see Figure 19.21), style (see Figure 19.22), theme (see Figure 19.23), and name (see Figure 19.24).

Figure 19.21. Select a layout for your report.


Figure 19.22. Select a style for your report.


Figure 19.23. Select a theme for your report.


Figure 19.24. Customize the name of your report.


With those elements in place you can now build the report. As shown in Figure 19.25, the complete report enables you to further customize any of the report elements, data placeholders, and layout options within the report.

Figure 19.25. The report template has been created.


The last step to creating your custom report is to save the report file. Each report is saved with a .cfr extension that the ColdFusion server can interpret. As you'll see in a minute, this single CFR page can then be displayed in a variety of different formats.

Tip

For a great walkthrough on using custom input parameters in reports, check out Ben Forta's tutorial at http://macromedia.breezecentral.com/p99229136/.




Special Edition Using Macromedia Studio 8
Special Edition Using Macromedia Studio 8
ISBN: 0789733854
EAN: 2147483647
Year: 2003
Pages: 337

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net