JReport Design Bean Usage

The JReport Design  (JRDesign) Bean is intended for users who want to call the JReport design from their java application to design the JReport report.  JReport Design Bean is almost the same as the JReport workbench except that users can not view the report. But creating and saving a new report is just like doing in the JReport workbench. After designing, save it to a .cls file, then the report could be turned into  JReport Engine to generate the report result file.   

Installation

JReport Design is presently available as a zip file jdbean.zip that contains the following components:

These files may be unzipped into any directory by your choice.  The following sections give further details about the JReport Design Bean.

When you compile and run your application that calls the design bean, be sure that the class path settings (which is required by the javac.exe and java.exe) contains the JDK 1.1.6 (or later) classes.zip and JRDesign.zip.

JRDesign Bean Properties

The JRDesign Bean has two properties.   All the data types of properties are java strings.  These properties are listed below:

Note that the reportName is a string which contains both the report path information and the report name.  If the user is going to design a new report with the design bean, the reportName should be " ".  User will give a reportName to the new report when saving the report. 

The following two methods are used for value assignment to the above two properties, the method runReport( ) will run the JRDesign bean.

Return Code

The method getStatus() returns a message about the status after the JReport Design Bean JRDesign is called.   The getStatus () method may return one of the following messages:

Illustrative Examples

There is an example program called TestDesignBean.java included in the JReport Design bean package.  Please refer to it for more programming detail.