f you don’t want to code a solution in SQL that will only return the first row of a multi-row data set, there is a solution in JasperReports. Select the detail band of your report, where the rowset is output.

Right click, and click on properties.

In the Print When expression box, add the following code:

new Boolean($V{REPORT_COUNT}.intValue() == 1)

This checks to see of this is the first row of the result set. If so, it will print out only that row. If not, you will not see that row in the report when you run it.

Leave a Reply

Your email address will not be published. Required fields are marked *