NOjeil Posted November 27, 2013 Share Posted November 27, 2013 Dear All ,I am calling the following code in order to get the jasperPrint object from the jasperReport jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, connection);My question is how to check if the resultSet of the jasperReport returned data or noNote the report may contains header , footer and labels so i can not check the pages size of the jasperPrint objectThank you in advance, Link to comment Share on other sites More sharing options...
abhimanyu.prasad Posted November 29, 2013 Share Posted November 29, 2013 You can use:<jasperReport ... whenNoDataType="AllSectionsNoDetail" ...>[/code]This will never show up the bands in <detail> if the datasource is empty or there are no existing rows.or use <printWhenExpression> at the band level. Link to comment Share on other sites More sharing options...
NOjeil Posted December 17, 2013 Author Share Posted December 17, 2013 Thank you abhimanyu.prasad ,but the attribute 'AllSectionsNoDetail' will not help me in my case since the detail band can contains data ,images , table headers and all these elements will appears if the report query does not return dataI fixed it by adding a property to the japserDesign fields and when getting the jasperPrint I looped it to check if this property exists for a jasper Print element, if it exists it means that the query of the report returns data else the report query does not return data 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