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

Printing invoice/order documents

edited March 2003 in General
Hi,

We are trying out an evaluation version of ReportBuilder V6 Enterpise
edition for use in our new application. We are extremely impressed with the
tool especially in consideration of our previous reporting tool.

A major setback with our previous tool was the inability to force a section
of a report to be printed at the bottom of the last page of a report. This
is a considerable limitation when trying to enable the user to print invoice
and order documents. The only way we could do it was to print it in the
Page Footer section which worked fine on 1 page documents but on multi-page
documents it printed the section at the bottom of each page.

In trying out RB we are experiencing the same problem. We would assume that
as RB is a very popular tool that you have overcome such limitations and
therefore we would appreciate it if you could provide some pointers as to
how to print a section at the bottom of the last page of report. If we can
overcome this problem with your tool we can see no other reason why we
should not integrate it into our latest application.

Thank you in advance of your help.

Regards

Gareth Connor
Adaptev Ltd.
Manchester
UK

Comments

  • edited March 2003
    You can use the footerband. However, you'll have to toggle the visibility so
    that it only prints on the last page. One way to do it is to check to see if
    you are on the last page of the report. Set the Report.PassSetting to
    psTwoPass. Then at the end of the first pass before the first page is sent
    to a device, you'll know the page count. Then in the sceond pass, in the
    Footerband.BeforePrint event, you can compare Report.AbsolutePageCount to
    Report.AbsolutePageNo to determine if the footer should be visible. Another
    way to do it is to set the visibility based on Report.Datapipeline.EOF,
    which will be true after the last detail band prints on the last page, which
    is also happens before the footer BeforePrint event fires.

    What if you want a footer on every page and a separate summary band on the
    last page? Set Footerband.PrintOnLastPage to false. Then use the
    summaryband to print the information. Use the Summaryband.PrintPosition
    property to tell the summary band to begin printing at a specified position
    on the page so that it appears to be alinged to the bottom. This will work
    for a static height summary band. The report engine doesn't handle a dynamic
    height summary band which is aligned to the bottom.

    To print a summary band which is dynamic height, aligned to the bottom,
    you'll have to let the report engine generate the summaryband normally and
    then reposition the output draw commands on the output page object right
    before the page is sent to the output device.
    http://www.digital-metaphors.com/tips/AlignSummaryToBottom.zip

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited March 2003
    Thank you for your quick response.

    I have tried your first suggestion which is to do with making the footer
    visible based on the EOF, which is similar to what I was doing before. The
    problem with this is that when previewing the document which has a few pages
    even though it makes the footer invisible it leaves it's space blank.

    Anyway I tried you other suggestion to do with using the summary band and I
    had better results with it. The only problem is that I use regions to
    display the invoice total and other summaries so when calculating the
    position of the summary band I thought all I need to add to the TList is the
    region which in turn will move all of it's child controls. I had to add all
    of the controls belonging to the region to the TList using
    fDrawCommandList.Add(aDrawCommand);

    Am I doing something wrong or is this how it works. I have set
    ShiftWithParent to True on all the controls belonging to the region.

    Regards

    Gareth Connor



  • edited March 2003
    Yes, each individual control creates an output draw command. You are doing
    it correctly.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.