2002 JI Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 By: Rick Sperko - rsperko Empty subreports not visible 2003-04-18 06:20 I am creating a report that has several subreports. I want the subreports to show up even if there is no data. My report and subreport use JRBeanCollectionDataSource. When the collection this is wrapping contains data the subreports show up fine. Here is the XML I am using to instantiate the subreport: <subreport> <reportElement width="250" y="40" x="300" height="30" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false"></reportElement> <dataSourceExpression>$F{currentPriceSurchargeRows}</dataSourceExpression> <subreportExpression class="dori.jasper.engine.JasperReport">$P{surchargeReport}</subreportExpression> </subreport> The getCurrentPriceSurchargeRows method on my row class returns a JRDataSource. As I said, the subreport works fine when there is data. Thank you, -Rick By: Enrico Goosen - enricogoosen RE: Empty subreports not visible 2003-05-13 02:46 Set the "whenNoDataType" attribute of the "jasperReport" element, so that the subReport displays even when the datasource is empty. Enrico 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