Jump to content
Changes to the Jaspersoft community edition download ×

Displaying Customized text When No Data

Recommended Posts

By: eric - greatmaster

Displaying Customized text When No Data

2006-02-15 11:58



i have a report which includes subreports.

When subreport queries doesn't return data i would like to display a text field (in master report) saying "No data for this section".

The WhenNoData property of a subreport allows only three cases : BlankPage, Nopage or DetailSection but not a customized message.


Any suggestion about this ?








By: Denny Valliant - xenden

RE: Displaying Customized text When No Data

2006-02-16 11:54

Use a printWhen expression?


Just a guess... but it should work!







By: Ionut Nedelcu - ionutned

RE: Displaying Customized text When No Data

2006-02-17 01:01

We suggest you create a text field that displays your custom message only when your subreport has no data. Doing this might be a little tricky, so be careful:


1. Your subreport whenNoDataType attribute must be NoPages

2. Use the subreport return variables feature. Create an integer variable in the master report that will receive the value of REPORT_COUNT from the subreport. If this is null or zero, than the subreport contains no data and you should display your custom text.

3. Your custom text field must check the value of this variable in the text field expression itself, using the printWhenExpression won't work. Also, the textfield evaluation time must be band.

4. If the subreport has data, the textfield should return null and have the isBlankWhenNull attribute set to true.


Let me know if you succeeded.



Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...