Jump to content
JasperReports Library 7.0 is now available ×

(dup) Master/Detail report shrink empty SubReport


jcullison

Recommended Posts

please ignore this post it is a duplicate

 

I have a master detail report with a subreport in the detail band of the master report. When the subreport has no data I want to get rid of the space the subreport would have taken. Right now, the rows on the master report are basically double spaced when there is no detail.

 

The data should look like this:

master record 1

master record 2

detail record 2a

detail record 2b

master record 3

master record 4

detail record 4a

detail record 4b

 

But instead it looks (incorrectly) like this:

master record 1

<blank row>

master record 2

detail record 2a

detail record 2b

master record 3

<blank row>

master record 4

detail record 4a

detail record 4b

 

Things I have tried:

set RemoveLineWhenBlank on the subreport component

set the no data behavior of the subreport to "no pages"

shrink subreport component very small

 

Shrinking the subreport component to 0 seems to work. But it makes the report hard to maintain in iReport, since there is just a black line representing the subreport, and in my case it is at the bottom of the detail band, right on top of a subreport at 0 in the group footer band. I can't visually see it, but I can find it in the Document Structure view.

 

I don't think this is iReports fault. I think this is a shortcoming of JasperReports. I'm not sure how yet, but I think there should be a way to make this more useable, such as an option on the subreports that subtracts their component height from the band they reside on, but only when they had no records or their printWhenExpression chose to not print.

 

Make any sense?

 

Thanks,

Jim

 

Post edited by: jcullison, at: 2007/10/10 17:22

Post edited by: jcullison, at: 2007/10/10 17:23

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