Page 1 of 1

Problem with groups aand PageHeader

Posted: Tue Dec 18, 2012 9:00 am
by rksaskia
Hello,

we have a problem with groups and pageheader with Print On-Property is set.

we want:
PageHeader 1 print on every first page of group
PageHeader 2 print except first page of group
GroupHeader
DataBand
GroupFooter

what we do:
Report: Double Pass
Page Header1: Print On "Only First Page"
Page Header2: Print On "Except First Page"
GroupFooter Reset Page Number = true; New Page After

What is here wrong?
pageheader1.png
pageheader1.png (42.11 KiB) Viewed 2395 times
pageheader2.png
pageheader2.png (57.9 KiB) Viewed 2395 times

Re: Problem with groups aand PageHeader

Posted: Wed Dec 19, 2012 10:31 am
by HighAley
Hello.

Your problem is in the Reset Page Number property of the Group Footer. It reset number of the current page.

We offer you to use a bool variable. It should have false init value. In the Before Print event of Group Header it will be set to true and in the Before Print event of Group Footer it will be set to false.
Also it's necessary to set the Condition of the both Page Headers.
Please look at the attached report template.
ReportmitGruppePageHeader1.mrt
(28.45 KiB) Downloaded 242 times
Thank you.

Re: Problem with groups aand PageHeader

Posted: Wed Dec 19, 2012 2:02 pm
by rksaskia
Thanks for your quick reply.
Some questions remain:
1. Why do you use Engine.NewPage() in the afterPrint-Event of the GroupFooter instead of "New Page After" Property of the GroupFooter? I know, New Page After dont work in your solution, but why? How should we decide, what is the right way?
2. How can we use the group value in the Page Header?
When we use New Page After" Property the group value is on the first Page wrong; from the second ok.
pageheader3.png
pageheader3.png (29.79 KiB) Viewed 2383 times
When we use Engine.NewPage(), on all pages wrong.
pageheader4.png
pageheader4.png (28.02 KiB) Viewed 2383 times
In Crystal Reports it works fine (in that case). See sample.

Understands us. We don't back to Crystal, but in that case StiReports don't work correct.

Ralf

Re: Problem with groups aand PageHeader

Posted: Thu Dec 20, 2012 9:52 am
by HighAley
Hello.

The main difference with Crystal reports is that several bands could be on the one page. So when the Page Header is printing the Data Band is not initialize the Data Source. So it's better to use the New Page After property of the Group Footer or the New Page Before property of the Group Header. But you should remember that the data is not initialized on the Page Header.

As a way you could use two Group Headers with one Condition. Please, look at the attached report template.
ReportmitGruppePageHeader3.mrt
(28.67 KiB) Downloaded 242 times
Thank you.

Re: Problem with groups aand PageHeader

Posted: Thu Jan 03, 2013 7:24 am
by rksaskia
Hallo,

thanks, is works and I understand the difference between Stimulsoft/Crystal Reports.

For the users of the forum:
The screenshot shows, why the solution works. I've been looking for a while ...
Condition.PNG
Condition.PNG (221.62 KiB) Viewed 2348 times
Happy new year!

Re: Problem with groups aand PageHeader

Posted: Thu Jan 03, 2013 12:49 pm
by HighAley
Hello.

Thank you for explanation.

Happy New Year!!!