subreports not collpasing when empty

hi guys,

i've two subreports printing in the summary of the main report. when there's no data in the subreports i'd like them be collapsed.

 

 

in order to do that i've set When No Data Type to No Pages in the subreports and i've set Remove Line When Blank to true to both subreports in the main report.

unfortunately it's not working. the subreports are taking all the space even if they're empty.

 

i've tried to delete the subreports to see if they're the cause and that's it.

 

awaiting your help!

 

 

daniel.mohorovic's picture
Joined: Sep 22 2015 - 11:44pm
Last seen: 6 years 8 months ago

hi guys! just a hint after the we? :)

daniel.mohorovic - 7 years 6 months ago

What vesion are you using?  Removing the space seems to work fine for me.  A (self contained) test case would of course help.

lucianc - 7 years 6 months ago

hi lucianc! thanks for your answer... i'm using 6.2.0.

what do you mean by "A (self contained) test case"?

daniel.mohorovic - 7 years 6 months ago
show 2 more...

A self contained test case means a set of jrxmls (and a static data source if required) that can be used to reproduce the problem on a different machine.

lucianc - 7 years 6 months ago

hi lucianc,

here are all ther jrxmls to build the report:

https://dl.dropboxusercontent.com/u/49472099/jrxmls.zip

you can run them with One Empty Record datasource and you'll see the following:

page 1

page 2

daniel.mohorovic - 7 years 6 months ago

7 Answers:

Hi, 
Have you tried a print when condition such that the sub-report doesn't get printed if the report count is null? If not, give it a try for respective subreports in the main report.

Regards,
KKriplani

kkriplani's picture
5776
Joined: Sep 4 2015 - 2:18am
Last seen: 1 year 5 months ago

hi KKriplani... thanks for your suggestion! i've already tried but i wasn't able to get it working! if you suggest is the right way to do that, i'll re-try... will let you know!

daniel.mohorovic's picture
Joined: Sep 22 2015 - 11:44pm
Last seen: 6 years 8 months ago

KKriplani, lucianc,

seems it's not the subreports... following KKriplani's suggesion i've tried ot use the REPORT_COUNT to do it and i've found out the following.

exists_clause and exists_discount_surcharge are the main report variables coming from the subreport's REPORT_COUNTs. i've placed them in order to debug:

previewing it, the first page is taking a lot of space after the detail:

but i see it's not due to the subreports... they're not printed when REPORT_COUNT is equal to 0. everything after detail goes to the second page:

 

any idea why there's so much space after detail?

 

 

daniel.mohorovic's picture
Joined: Sep 22 2015 - 11:44pm
Last seen: 6 years 8 months ago

just to be complete... here's how it looks like when the subreports are returning something!

 

daniel.mohorovic's picture
Joined: Sep 22 2015 - 11:44pm
Last seen: 6 years 8 months ago

here are all ther jrxmls to build the report:

https://dl.dropboxusercontent.com/u/49472099/jrxmls.zip

you can run with One Empty Record datasource and you'll see the following:

page 1

page 2

daniel.mohorovic's picture
Joined: Sep 22 2015 - 11:44pm
Last seen: 6 years 8 months ago

moving everything from summary to a new detail 2 band makes it better...

but it doesn't sound right... does that make sense to you?

 

 

 

daniel.mohorovic's picture
Joined: Sep 22 2015 - 11:44pm
Last seen: 6 years 8 months ago

Idea off the top of my head.  Haven't tried it.

Can you use a Return Parameter, and then use a Print when Return Parameter .equals(null) ?

 

I just tried this, and I had no luck making it work.  Sorry.

mwarner_2's picture
2176
Joined: Jul 10 2015 - 1:17pm
Last seen: 6 years 1 month ago
Feedback
randomness