Problem with groups aand PageHeader

Stimulsoft Reports.NET discussion
Post Reply
rksaskia
Posts: 58
Joined: Fri Apr 27, 2012 9:16 am

Problem with groups aand PageHeader

Post 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 2399 times
pageheader2.png
pageheader2.png (57.9 KiB) Viewed 2399 times
Attachments
ReportmitGruppePageHeader1.mrt
(28.09 KiB) Downloaded 219 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problem with groups aand PageHeader

Post 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 243 times
Thank you.
rksaskia
Posts: 58
Joined: Fri Apr 27, 2012 9:16 am

Re: Problem with groups aand PageHeader

Post 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 2387 times
When we use Engine.NewPage(), on all pages wrong.
pageheader4.png
pageheader4.png (28.02 KiB) Viewed 2387 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
Attachments
ReportmitGruppePageHeader1.mrt
(28.09 KiB) Downloaded 216 times
BerichtGroupPageHeader.zip
Crystal Report sample
(26.47 KiB) Downloaded 215 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problem with groups aand PageHeader

Post 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 244 times
Thank you.
rksaskia
Posts: 58
Joined: Fri Apr 27, 2012 9:16 am

Re: Problem with groups aand PageHeader

Post 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 2352 times
Happy new year!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problem with groups aand PageHeader

Post by HighAley »

Hello.

Thank you for explanation.

Happy New Year!!!
Post Reply