Parameters are passed into the report generator so that they can be used in the SQL query for the report

Parameters are referenced in Jaspersoft Studio with a $P{} designation. For example a parameter called “startdate” would be referenced as $P{startdate}.

use $P{parameter name} as a placeholder for the passed in parameter called “parameter name”.

Important: do not skip this step or the default parameter values you used for testing the query will be used in your report

To log the JDBC activity for the report, use log4j and the logger “net.sf.jasperreports.engine.query.JRJdbcQueryExecuter” in the log4j.xml.

For example:

 <logger name="net.sf.jasperreports.engine.query.JRJdbcQueryExecuter" additivity="false">
	    <level value="debug"/> 
	    <appender-ref ref="someappender" />
 </logger>

where you have defined “someappender” in your log4j.xml file, such as a file or console appender.

  • advancedparametersjasperreports.txt
  • Last modified: 2022/06/23 19:14
  • by wikiadmin