Band at the bottom of the first page
Good evening,
I am trying to make a report and I need a band at the very bottom of the first page, it must behave exactly like the PageFooter but it can't repeat on every page, only on the first one.
I can't set visible false on a normal PageFooter because the band will keep wasting space, so far I am trying to Free and Create the band manually but FR doesn't work very well with that kind of manipulation.
I really have no idea what to do and any help will be appreciated.
Edit1: I am using Double Pass.
I am trying to make a report and I need a band at the very bottom of the first page, it must behave exactly like the PageFooter but it can't repeat on every page, only on the first one.
I can't set visible false on a normal PageFooter because the band will keep wasting space, so far I am trying to Free and Create the band manually but FR doesn't work very well with that kind of manipulation.
I really have no idea what to do and any help will be appreciated.
Edit1: I am using Double Pass.
Comments
the basic is to use an unattached child band.
write code in the oap event of the preceding band to call engine.showband(bandname);
it may be as simple as checking the line variable's value and making the call or checking
the engines.freespace value
I will try to use the Engine.ShowBand to see what happens
*Edit: Engine.ShowBand doesn't work, I need something to don't show the PageFooter.
This is what comes before the pagefooter:
http://i.imgur.com/yEaxB.jpg
I need:
First page:
Data Data
Data Data
Data Data
Footer
Next pages
Data Data
Data Data
Data Data
Data Data
Data Data
Data only...
Try this solution:
In PageFooter OnAfterPrint:
PageFooter1.visible := false;
In Detailband OnAfterPrint:
if not PageFooter1.visible then
PageFooter1.height := 0;
This will make the pagefooter to print only on first page, without taking space in the rest of the pages.
Petter
Thank you for the hint, it didn't work though. I added a Visible := False OnAfterPrint but FR didn't respect it, the PageFooter was still visible.
I messed a lot with visible, height, free and create... FR doesn't respect that kind of manipulation, specially when Double Pass is on.
I am still trying to find a way to make it work, so far I am 4 days on this report and I feel that everytime I am almost finishing there is something that FR can't do and I must remake the whole thing with a different approach.
In PageFooter OnAfterPrint:
if Engine.Finalpass then
PageFooter1.visible := false;
In Detailband OnAfterPrint:
if not PageFooter1.visible and Engine.Finalpass then
PageFooter1.height := 0;
This works fine in my test-case. I get details+footer in page1, and just details in page 2+.
My experience is that FR responds well to modifications of visibility an size, but there can be challenges in finding the right events to put your code.
Petter
Petter
The first pass will consider Footer in every page, so it might happen this bug:
First Pass
(Page1)
Data
Data
Data
Footer
(Page2)
Data
Data
Data
Footer
(Page3)
Data
Footer
Total Pages: 3
Second Pass
(Page1)
Data
Data
Data
Footer
(Page2)
Data
Data
Data
Data (Data is printed instead of the footer and 2 pages are enough)
Total Pages: 2
Since I must show how many pages the report has in every sheet (1/3, 2/3, 3/3) I will have issues with page counting, therefore this approach isn't viable [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> I will check the .fr3 you uploaded. Thank you for the help, Ingo Wagner.[/img]
Here is another approach: Store the height of your footer in a variable initially, and then set the properties of the footer in a oap-event of the detailband, depending on the page number.:
Modified report attached.
Petter
FooterPage isn't accepting Height changes.
I found a way though...
I deleted the PageFooter and added a ReportSummary.
ReportSummary1OnBeforePrint I made it always print at the bottom of the page.
OnBeforePrint on MasterData1 I made a condition
OnAfterPrint of ReportSummary1 I did this So far it's working like a charm.
I will make more tests tomorrow but I am pretty sure it's working pretty well.
The previously attached report HiddenFooter1.fr3 accepts height changing from script on my system. Might there be that there are differences between FR-versions? My version is 4.11.4.
Petter
We are using 4.9 here. It might be it...