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

Print Something Else If Subreport is Empty?


someguy51

Recommended Posts

Hi,

 

Is there any way to test if a subreport is empty? (it has no data to display). I am trying to display some alternate text if there is nothing in the subreport.

 

I have a static text field with the alternate text and have been trying to come up with a "Print when expression" to hide the text if the subreport is empty. However, I don't know what that expression would be.

 

Thanks,

Chris

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

In your sub report go to the Report Properties and go to the more tab. Set "When no date" to "All sections, no details".

 

Put your text in a band that does not contain any other information.

 

Set the print when expression of this band to

 

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

 

The frame will print when you query does not return any data.

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