Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Problem getting footer to print only on first page / Detail band printing underneath

edited April 2012 in General
Hi,

I have a report I'm trying to design where I only want the footer to
print on the first page.

I can get this to work by putting in the following line in the footers
OnBeforePrint event:

Report1.FooterBand.visible := Report1.AbsolutePageNo < 2;

However - when I print the report, while it only prints the footer on
the first page, the detailed band continues to print 'underneath' the
footer, instead of rolling those records onto the second page.

I have set the report's Passtype to TwoPass but this has not helped.

The footerband is of static height.

If I comment out the line so the footer is visible to all pages, the
detail band works as expected. (Does not print 'underneath' the footer).

I'm sure that I'm just missing something simple, but can't seem to find
out where it is.

I'm running 14.04 on Delphi 2007

Thanks & Regards

Adam.

Comments

  • edited April 2012
    Hi Adam,

    I'm a bit unclear what you mean by "underneath" the footer.

    By definition, the Footer band will take up the space at the bottom of
    each page. There is no way for detail information to print below this
    band. Are you experiencing some sort of overlap where the detail
    information is printing behind the footer?

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2012
    Good Morning Nico,

    Correct - their is an overlap. The detail band is printing behind the
    footer when I attempt to do this.

    Best Regards

    Adam.
  • edited April 2012
    Hi Adam,

    We have not seen this behavior before. If possible, please send a
    simple example I can run on my machine demonstrating this issue to
    support@digital-metaphors.com in .zip format and I'll take a look at it
    for you.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2012
    Hi Nico,

    I have emailed a small example unit through that replicates the problem
    I am currently experiencing.

    Thanks & Regards

    Adam.

  • edited May 2012
    Thanks Nico for your help via email.

    Just for anyone else who may be browsing the newsgroups or archives with
    the same issue - here's what we had to do.

    First of all, we had to change the code to the following:

    if PackInstDetR.SecondPass then
    PackInstDetR.FooterBand.visible := PackInstDetR.AbsolutePageNo < 2;

    The first line is required if the report is set for TwoPass.

    While this stopped the first page from having the detail band print
    underneath it, it had a weird side effect in that the second page's
    detail band also stopped printing at the same spot even though the
    footer wasn't printing on the second page. (This left a blank area on
    the 2nd page).

    Subsequent pages (3rd, 4th, 5th, etc) were not affected, and printing as
    expected.

    The correction to this was to move the code from the OnBeforePrint
    event, to the *Reports* onStartPage event.

    Appreciate the help Nico. Hopefully this helps someone else down the
    track with a similar issue.

    Cheers

    Adam.
This discussion has been closed.