JReport Conditions Bean Usage

This bean will provide a panel that will allow a WHERE portion to be specified or modified.  A WHERE portion is part of query and is used for specifying the conditions for the query.  A query is used for specifying the data source for a JReport report.

First of all, download jQueryWidget.zip file from www.jinfonet.com.

There are 2 files inside  jQueryWidget.zip:

 

Invoking JReport Conditions Bean

There are three major properties in this bean:

There are six methods that are related with those properties:

Note:

    1. Before call method setReportName and setWherePortion, the method setCatName should be called.
    2. Because this bean will pop up some dialogs (for example: show query dialog), you have to set a showing frame to this bean in order to show those dialogs, otherwise a NullPointException "null parent frame" will be thrown. There are two ways to set a showing frame to this bean: call the method setFrame (Frame frame) or add this bean to a parent that has already been shown, these two methods should be called before set the values to the bean's property.

Return Code

Check Return Code

The method getStatus ( ) should be called each time after call the Query Widget Bean's method.  The return string "OK" means the method is executed successfully otherwise an error message will be returned.

Show information

The properties showInfoLevel and logFile are used for controlling display debug, error and other information.  The following two methods are used to set the values to these two properties:

vDebug, vError and vOff are used for showing debug information, error information and turning off debug and error information respectively.  LogFileName specifies where the debugging, error and other information will go.  LogFileName contains both path and file name information.  If no path is specified, the current path is used.  If no file name is specified, the file name jreport.log is used.

 

Illustrative Examples

The example program TestConditionsBean.java shows you how to call JReport Conditions bean.  Please refer to it for details.

To compile this program using Sun's JDK 1.1.6 or above, the command line will be:

javac -classpath c:\jdk\lib\classes.zip;c:\jreport\lib\jQueryWidget.jar TestConditionsBean.java

To run this program using Sun's JDK/JRE 1.1.6 or above, the command line will be:

java -classpath c:\jdk\lib\classes.zip;c:\jreport\lib\jQueryWidget.jar;. TestConditionsBean

 

If you have any question or suggestion, please send your mail to suppoer@jinfonet.com