Invoking Reports from Within ColdFusion Code

Being able to run reports in browsers is useful, but other reporting tools can do that, too. What makes ColdFusion reports unique is their ability to be altered at runtime.

Look at Listing 16.13. It uses a tag named <cfreport> to embed a report into a .cfm file.

Listing 16.13. Report1.cfm—Basic Report Invocation
<!---
Name:        Report1.cfm
Author:      Ben Forta
Description: Invoke a ColdFusion report
Created:     07/10/2007
--->

<cfreport template="Expenses.cfr"
          format="PDF" />

If you were to run this code, it would generate the same report as before, but now you’re generating it in your own CFML instead of it’s being generated automatically. Why is this of value? Look at Listing 16.14, a modified version of ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.