Skip to Content

Powerbuilder Footer should only be displayed on the last page of report

Hi,

I am using Powerbuilder 11.5 and I am fairly new to the program.

I want information to be displayed at the bottom of the last page of a report. I used a footer to do this and set it to invisible on every page but the last one using this expression: "IF( page() = pagecount(),1,0)". The result was that I got blank areas on the other pages where the footer would be. Those blank areas are taking up to much space on each page. Does anybody know a solution to this problem?

Thank you in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Dec 22, 2014 at 04:57 PM

    That is the purpose for the summary band.  Is that an option - even if you need to dynamically "push" it down with extra blank lines?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 22, 2014 at 06:48 PM

    Hi Paul,

    Have you tried setting the height.autosize=yes for the footer band? Be sure and set the band height to zero in the painter and and at run time it should adjust based on content.

    hth,

    Mark

    Add comment
    10|10000 characters needed characters exceeded

    • Thank you, but I looked for fields that I might have overlooked and tried using several different datawindows and the effect was the same every time.

      No, there are no other copies in another .pbl.

  • avatar image
    Former Member
    Dec 28, 2014 at 06:38 PM

    Hi,

    To my knowledge this never worked in powerbuilder.  I asked for this multliple times in the past.

    We are having a simple invoice layout with company header/detail invoice lines/footer total of the invoice. All works fine when there's only one page to be printed. In case there are 2 or more , then the footer band takes 'white space' on every page except for the last one. We want the details from the detail band to use the whole first page across the current white space but this never worked for us. My guess is that the autoheight for footer band doesn't work... (?)

    This didnt work in PB5, PB8 and neither did it in PB11.

    The summary band can be used , but then the totals are printed directly after the last detail records , which we don't want. Its not our standard accepted invoice layout over here . The total of the invoice should be at the bottom of the last page of the invoice, and should not take any whitespace on any other other pages...

    Maybe someone has a workaround , tried many, as many failed ....

    Kind regards.

    John

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 28, 2014 at 10:17 PM

    Did you try to set the height of the footer programmatically in the PrintPage event ?

    You have to obtain the pager count. Ether by storing it into an instance variable in the printstart event or like this:

    ll_PageCount =  long ( dw_1.describe   ("evaluate('pagecount()'," + string ( dw_1.rowcount() ) + ")"))
    (from: Get the page count of a report - Real's PowerBuilder How-to )

    So it is in the printpage event:

    long    ll_PageCount

    ll_PageCount =   long ( dw_1.describe  ("evaluate('pagecount()'," + string ( dw_1.rowcount() ) + ")"))

    if ll_PageCount = pagenumber then

        dw_1.Modify("DataWindow.Footer.Height='<an integer of your need>'")

    else

      dw_1.Modify("DataWindow.Footer.Height='0'")

    end if

    I don't have the time to test it now, ;-)

    But HTH, Ludwin

    Add comment
    10|10000 characters needed characters exceeded

    • Hello,

      thank you for your suggestion.

      When I put the code in the printpage event as you suggested the format is way off. It seems that as soon as the height is modified in the print page event there are only about two centimeters on the left side of the sheet that have anything printed on them. The remaining area of the sheet is white. Do you maybe have an idea why this happens?

      I am currently using a freeform datawindow.

      Paul

  • avatar image
    Former Member
    Dec 29, 2014 at 04:34 PM

    How about putting the summary in a separate dw and put it on the Detail band of the composite datawindow with the visible expression like, if(getrow()=rowcount(),1,0)?

    Add comment
    10|10000 characters needed characters exceeded

    • I tried using a composite datawindow as well, but I am not sure how this helps. Could you please be more specific? I get it to print in the order I want but how do I get the summary to move down to the bottom of the page? I was told to avoid composite datawindows in the past and I don't have much experience with them.