Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

view SQL executed by Jasper report

When running a Jasper report in which the SQL is embedded in the report file (.jrxml), is it possible to see the SQL that is executed? Ideally, I'd also like to see the values that are substituted for each of the $P{} placeholders.

Cheers,

Don

like image 523
Dónal Avatar asked Oct 16 '08 17:10

Dónal


People also ask

How do I view a query in jasper report?

Click on manage->server settings->Ad-hoc settings-> Select Enable view query in Ad-hoc editor. Create ad-hoc view, one button will be enabled to see query. Click that and get query.

Where can I find JasperReports properties?

At JasperReports levelIn <jasperserver-root>/WEB-IN/classes you can find the file jasperreports. properties. This is the file that you need to modify to set some properties to the value you want for all reports running in JasperReports Server. Similarly you can set some properties at iReport level.


1 Answers

JasperReports uses the Jakarta Commons Logging API. Commons Logging has a discovery mechanism that connects to logging API you are using in your project.

You need to configure logger named "net.sf.jasperreports" in your logging configuration file to control the logging level of JasperReports.

If you are using Log4j, you can read this section of there documentation for exact details.

For example you may write something like this in log4j.properties file

log4j.logger.net.sf.jasperreports=INFO, Daily

Where "Daily" is name of an appender configured in same properties file.

like image 59
Tahir Akhtar Avatar answered Oct 12 '22 23:10

Tahir Akhtar