Chapter 28. Reporting System

Table of Contents

Introduction
The Reporting Interfaces
Running a Report
Prepare the Report
Accessing the Report Controller
Conclusion
Contributors

Note

If you find this EDG documentation helpful please consider DONATING! to keep the doc alive and current.

 Maintainer:David Lloyd

Introduction

Nearly any J2EE application worth its salt will have some sort of reporting requirements. This is not something Expresso has left unthought of! Expresso 5.3 introduces a series of interfaces that provide for a generic reporting framework. It also provides an implementation of this framework that outputs raw html. In this chapter we will study the interfaces more closely, and show how Expresso can assist you in your reporting needs.

Note

While any developer can create their own interfaces to their preferred reporting engine using the details provided in this chapter. You may want to consider purchasing a license of JCorporate's eContent content management framework. eContent takes the basic Expresso interfaces and provides: Per-report security, multiple export formats such as PDF, XML, Excel, and Html; and integration with popular reporting engines that only require xml definitions rather than manual Java code.

The Reporting Interfaces

The reporting interfaces that come with Expresso are quite simple:

A super quick explanation of the classes is as follows:

  • ExpressoReport: This is the base interface for all the reports.

  • MultiFormatReport: This is the interface for report classes that can output several formats. For example, some reporting engines can export to CSV, Excel, PDF, or HTML formats. So if the report engine you're tying in has these kinds of capabilities, then you will want to implement this interface.

  • ReportPage: This is a concrete implementation of Expresso report that has it's roots from many years ago. It can only output to HTML and stores all the elements in memory. So while it is not advised for serious reporting, it can certainly work for basic usage.

While these explanations may not give you a lot to go on, please check the javadocs on these interfaces as it has been attempted to show users what each method is supposed to do.

Running a Report

Prepare the Report

To prepare your report implementation you will need to add it to the Schema. Do this through the schema's addReport(Class) method in your Schema's constructor. Use it the same way you use addDBObject() or addController().

addReport(org.example.myapp.DonationsReport.class);

Accessing the Report Controller

Expresso has a simple controller implementation that allows you to run a report. The controller's typical location is [context path]/ExpressoReport.do. Start at that location and it will lead you through the steps to run the report you have created.

If you are interested in creating your own report runner, check out the code to ExpressoReport.do. It is com.jcorporate.expresso.ext.controller.ReportServer. Check the source code for an example on how to drive the report and grab the output of the report.

Conclusion

Contributors

The following persons have contributed their time to this chapter:

  • Mike Rimov

Note

Was this EDG documentation helpful? Do you wish to express your appreciation for the time expended over years developing the EDG doc? We now accept and appreciate monetary donations. Your support will keep the EDG doc alive and current. Please click the Donate button and enter ANY amount you think the EDG doc is worth. In appreciation of a $35+ donation, we'll give you a subscription service by emailing you notifications of doc updates; and donations $75+ will also receive an Expresso T-shirt. All online donation forms are SSL secured and payment can be made via Credit Card or your Paypal account. Thank you in advance.

Copyright © 2001-2004 Jcorporate Ltd. All rights reserved.