### Engine Bean properties

JReport Engine Bean contains the following properties. All the data types of these properties are of Java string. The properties are listed below:

Property | Description
--- | ---
UID | The JReport Runtime user ID.
key | The JReport Runtime key.
reportHome | The home path where report.ini and other JReport system files exist.
reportName | The name of the report which will be run by the engine.
catName | The name of the catalog which contains all the required objects used in the report.
paramValues | The string containing the parameter values, separated by a comma (',').
paramFile | The name of the parameter value file. This will be ignored if paramValues has been specified.
resultFile | The name of the result file.

The following methods are used for assigning values to the above properties:

- setUID("UID")
- setKey ("key")
- setReportHome("HomePath")
- setReportName("ReportName")
- setCatName("CatalogName")
- setParamValues("ValuesString")
- setParamFile("ParamFileName")
- setResultFile("ResultFileName")
- runReport( ) or runReport(boolean genRst)

Where

- UID - The JReport Runtime user ID.
- Key - The JReport Runtime key.
- HomePath - The installation path for JReport Designer. Strictly speaking, if you set the ReportHome as `c:\\jreport\\designer`, then the first thing JReport Engine Bean will do when running a report is to check the jslc.dat and report.ini files in `c:\jreport\designer\bin` are valid.
- reportName - A string which contains both report path information and the report name.
- catName - A string which contains both catalog path information and the catalog name (the report path and the catalog path may be different).
- ValuesString - A string which assigns a new value to the parameter used in the current report. The parameter should be the one defined in the catalog.
- ParamFileName - The name of the parameter value file. This will be ignored if paramValues has been specified. The format of the parameter file is: one parameter name-value pair will take one line, and another parameter name-value pair will start from a new line. Each line is formatted as paramname=paramvalue, and you are also provided with the escape operator (\\) for equal sign same as above.
- ResultFileName - The name of the result file. If you want to generate a report result file (with an .rst extension), then set the result file name (with an .rst extension) with a full file path. For example, setResultFile(`"c:\\temp\\test.rst"`). The resultFile contains both the path and the file name information. If there is no path specified, the current path will be used. If there is no file name specified, the reportName will be used (with an .rst extension).

Notes:

- When you call JReport Engine Bean in your application program, your Runtime user ID and Runtime key are required.
- The method runReport( ) has the same effect as setLoadReport ("yes").
- When JReport Engine Bean runs the report result, it will generate an .rst file first. However, you may want to run the report result and then export it to other formats such as HTML and PDF without generating an .rst file. This feature is now supported. The method runReport( ) and runReport(true) are equivalent, and each method will always generate an .rst file. If you do not want to generate an .rst file, you can call runReport(false). This method will print, and output the report result without generating an .rst file and the performance will also be improved.
- If more than one parameter is needed in a report, you can pass multiple parameters in the paramValues string. The ValuesString format is: paraName1=paraValues1, paraName2=paraValue2 where paraName1 and paraName2 are the parameter names and paraValue1 and paraValue2 are the values. The comma is the separator operator, and the equal sign for separating the parameter name and parameter value. If the parameter name or parameter value contains a separate operator (comma or equal sign), it will need an escape. JReport has therefore provided an escape operator -- \\. If you put the escape operator before the separator operator, it will not be treated as a separator operator. For example:

  * the parameter string is: `"param1=aaa\\,aa,param2=bbbbb,param3=ccccc"`

  it will be parsed to:

  the value for param1 is aaa, aa
  the value for param2 is bbbbb
  the value for param3 is ccccc

  `* the parameter string is: "pa\\=ram1=aaa\\,aa,param2=bbbbb,param3=ccccc"`

  it will be parsed to:

  the value for pa=ram1 (name) is aaa, aa (value)
  the value for param2 is bbbbb
  the value for param3 is ccccc

  The format of the parameter file is: one parameter name-value pair will take one line, and another parameter name-value pair will start from a new line. Each line is formatted as paramname=paramvalue, and JReport has also provided an escape operator (\\) for the equal sign same as above.

  When passing multiple parameters in the paramValues string, note that you do not have to set all parameter values. If you do not set a parameter value, JReport will use the default value. Also, if you want to know the report's parameters without running reports, you can call the method getReportParams(). This method will return a vector, and each element of this vector is jet.formula.ParamDesc. The class ParamDesc has five public properties:

  - name - Parameter name. This property is of String type.
  - type - Parameter type. This property is of String type.
  - promptText - Parameter prompt text. This property is of String type.
  - value - Parameter value. This property is of String type.
  - isColumn - Indicates whether the parameter must be of DB column name type or of Boolean type. If the parameter is of DB column name type, its value must be an available group field. By calling the method getAvlGroupFields(), it will return a vector which contains all the available group fields. However, note that if more than one parameter is of DB column name type, their values cannot be the same.