Context classes

The Context classes support specific data formats that, in combination with the OutputQueue and SpooledFileOutputStream classes, enable the ReportWriter classes to generate reports in that format and put those reports in a spool file.

Your application only has to create an instance of the Context class, which the ReportWriter classes then use to generate the reports. Your application never directly calls any of the methods in either Context class. The PCLContext and PDFContext methods are meant to be used internally by the ReportWriter classes.

Constructing an instance of the Context class requires an OutputStream (from the java.io package) and a PageFormat (from the java.awt.print package). The following examples show how you can construct and use the Context classes with other ReportWriter classes to generate reports:

Example: Using XSLReportProcessor with PCLContext

Example: Using JSPReportProcessor with PDFContext