In the sample program ParamTest.java in <install_root>\help\samples\APIParameter
, different values were assigned to the parameter p_StartDate by accessing values from an HSQL database. In addition, the sample report CustomerAnalysis.cls
uses this parameter in the query condition. So here, we use this demo report as an example to explain how to import parameter values from a database, so that you do not need to type in the values one by one while specifying the parameter default value (note that in this example we assume your JReport Designer is installed in the default path, that is C:\JReport\Designer
).
C:\JReport\Designer\help
.javac -classpath c:\JReport\Designer\lib\JREngine.jar; ParamTest.java
C:\JReport\Designer\help
to the ADDCLASSPATH variable of setenv.bat in C:\JReport\Designer\bin
.Tip: The report node is not shown in the resource tree of the Report Inspector by default. To have it shown, select the report tab node in the tree (in this example, the CustomerAnalysis node), and then click the Up button on the Report Inspector toolbar.
C:\JReport\Designer\help
to the ADDCLASSPATH variable of setenv.bat in <server_install_root>\bin
.Note: In the sample ParamTest.java, we used the method compareToIgnoreCase( ) to compare the parameter name in the class file with the one in your report. This method is not case sensitive when performing the comparison.