Jump to content
We've recently updated our Privacy Statement, available here ×

Conditional text when no data found...


milito

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

By definition you won't be able to put such a field in the Detail Section because it won't exist if there's no data.

 

 

To determine that there's no data you inspect the inbuilt variable REPORT_COUNT. If it is zero then the report is empty. Unfortunately the value isn't available until the report is filled, and that means you can't put it in a header or title section either.

 

 

First you need to set the Report Property setting whenNoDataType to "AllSectionsNoDetail"

 

 

Now you need to set up a text field in any FOOTER or SUMMARY section, with a printWhenExpression setting of "new java.lang.Boolean($V{REPORT_COUNT}.intValue()==0)".

 

 

If you put this field in a footer section then the text is going to appear at the bottom of the page.

 

 

The summary section is a better place to put it, as it will appear right underneath your report title and page header.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...