Jump to content
JasperReports Library 7.0 is now available ×

Empty subreports not visible


Recommended Posts

By: Rick Sperko - rsperko

Empty subreports not visible

2003-04-18 06:17

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: Teodor Danciu - teodord

RE: Empty subreports not visible

2003-04-18 07:49

 

Hi,

 

Use whenNoDataType="AllSectionsNoDetail" for

your subreport template.

 

I hope this helps.

Teodor

 

 

 

 

 

By: Rick Sperko - rsperko

RE: Empty subreports not visible

2003-04-18 08:13

Beautiful, I was looking in the wrong place. Thank you.

 

 

 

 

By: Marco Bucciarelli - marcobuc

RE: Empty subreports not visible

2003-04-24 07:23

Hi,

I want to generate a report containing some subreports and I would like to pass to the subreports the JRDataSource that I use to build the master report, rather than a Connection (as I can see, Rick does this).

I now call the master report in a servlet with the code used in the DataSource sample:

byte[] bytes =

JasperRunManager.runReportToPdf(

reportFile.getPath(),

parameters,

new WebappDataSource()

);

 

Where can I find more information on doing this?

Can you perhaps send me some detail on your approach and your solution?

 

Thanks,

Marco.

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