Print Page | Close Window

Keep subreport together with detail

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21430
Printed Date: 29 Apr 2024 at 4:18pm


Topic: Keep subreport together with detail
Posted By: brain
Subject: Keep subreport together with detail
Date Posted: 14 Apr 2015 at 5:53am
I have a detail section with a subreport. "Keep Object Together" for the subreport keeps it together as an entity; however, I also have "Keep Together" checked for the detail section. But the subreport goes to a new page when the data in the detail section, above the subreport, extends to the bottom of a page.

I have tried adding detail b and putting the subreport there instead of inside detail a, but with no change of behavior. I have tried every combination of enabling/disabling "Keep Together".

How do I force the detail to go to a new page when necessary so that the subreport inside the detail will stay together with the detail?



Replies:
Posted By: DBlank
Date Posted: 14 Apr 2015 at 9:03am
I have found the keep detail togther does not do much when you have items with in it that can grow. The detail section seems to "keep together" as much as the original height of that section in the design.
SOme of this depends on if you have any items set to 'can grow'.
A few thoughts-
1 -You might consider creating another group level that allows the grouping for each detail record then set that goup to keep together in the group expert. 
2 -You also might consider expanding the top of the sub report a bit to overlap the items you want to 'keep together'.
3 - push the fields into the sub report using shared variables
4 - consider using the overlay function
if none of these work please explain how you have items set up including the 'can grow' settings.


Posted By: brain
Date Posted: 14 Apr 2015 at 10:19am
The overlap worked perfectly. I just added a text label inside my detail section, suppressed it, then dropped it down a bit so it overlapped the subreport--and now the subreport stays together with the detail.

The issue was, indeed, that the subreport needs to be able to grow, since it can have one or more records in it.

Thank you!



Print Page | Close Window