views:

1798

answers:

5

My application prints statements for customers. Naturally, I want each customer's statement to start at the top of a page. How do I make it do that?

In the Section Expert, if I check 'new page before' the first group, it wastes a page at the beginning, and if I check 'new page after' the last group, it wastes a page at the end. I don't mind so much when printing 350 statements, but when I print just one, it's pretty low class as well as wasteful.

This is the 'built in' Crystal Reports in Visual Studio.

A: 

Do you have 'keeptogether' set? You should be able to do 'new page after' on the group footer and it will only go to the next page if there is a following group. Otherwise it will print the page and report footer.

asp316
A: 

You might be able to use a formula for the 'new page before' option. Something like the below would return true for pages 2+ of course, giving you the new page when needed. Just a theory. :)

PageNumber > 1
RayOK
A: 

I tried "keep together" but it still printed an extra page with the page header.

SeaDrive
A: 

use this on new page after

Not(OnLastRecord)

A: 

Hi,

Just write down the two lines of codes and it will work properly--

rDoc.ReportDefinition.Sections["GroupHeaderSection1"].SectionFormat.EnableNewPageBefore = true; rDoc.ReportDefinition.Sections["GroupHeaderSection1"].SectionFormat.EnableKeepTogether = true;

Thanks and Regards