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

Print when expressions and null report counts


irdmo

Recommended Posts

 

Dammit, I'm sense I'm racking up serious idiot points on this one...

I'm trying to achieve the basics: Based on the returned REPORT_COUNT from a subreport into a local integer variable (with "Do nothing" operation), display a message "No results returned", or display the actual results.

I've tried a plethora of different "print when" expressions, but never get it right. I've tried variations on:

  • $V{reccount}.compareTo( new BigDecimal("0") ) == 0 ? Boolean.TRUE: Boolean.FALSE
  • ($V{reccount} == null) ? Boolean.TRUE : Boolean.FALSE
  • new Boolean($V{reccount} == null)
  • new Boolean( $V{reccount}.intValue() == 0 )

I don't know if it's the null comparisons which are messing me around, so to ask the question another way: When I get the report count from the subreport, I'm using it in the main report to display a message like "Records processed: 123". When there's no data in the subreport, I get "Records processed: null". Is there a way to default the value of the returned variable to zero? I tried setting the "Initial Value Expression" to "new Integer("0")" without success.

 

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