However the problem I have is that the pagebreak now occurs even if I never change the value in the OnGetBreakValue event - simply the changing of Group1 also causes Group2 to reset at the same time, triggering the page break.

I can't swap Group2 and Group1's positions around, as I may want to force the pagebreak half way through Group1 in some instances.

Is it possible to stop Group2 from pagebreaking when Group1 rolls over, even though Group2 is closer related to the detail band?

Or is there a better way to achieve this?

Thanks & Regards

Adam.

Comments

The design you have is more of a "nested" group structure rather than two separate groups working independently as you need. If you need to use an individual group for breaking pages, you may need to move it (as well as the relevant data) to a subreport.

Have you tried using the TppPageBreak component? You can toggle its visibility based on the detail band's value so it will only break to a new page in certain cases. This may be a simpler solution than using multiple groups.

I did try using a TppPageBreak component, but for some reason I was getting some access violations occur part way through the report. I wasn't able to figure out why - the code was very basic and it was just turning visibility on and off.

However I believe I’ve found a solution:

I've found if I set ppGroup2’s NewPage property to false at design time, and then within the OnGetBreakValue set whether I want it visible or not each time it fires such as the below it works: