2004 IR Help Posted August 21, 2006 Share Posted August 21, 2006 By: Rebecca Peltz - rebecca_peltz Hiding a label if there is no matching data 2005-05-26 15:59 I have a label that appears next to a subreport. If the subreport is empty I don't want to display the label. I tried using a PrintWhenExpression looking the the datasource to be null, but this didn't work. Apparently the datasource is not null even if there is no data in it. I looked at the datasource API to see if there is a getCount method, but couldn't find any. What would be a good test for me to use to cause a label to print only when a dataset has row. Here is the expression I tried that didn't work: new Boolean (((net.sf.jasperreports.engine.data.JRXmlDataSource) $P{REPORT_DATA_SOURCE}).dataSource("/Quote/TransportationItem/BasicCharges/TransportationItemCharge[itemGUID=" + $F{ItemGUID} + "' and ChargeOutputType='DESTINATION]")!=null) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now