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

BottomOffset of DetailBand

edited November 2004 in General
I need to make some changes to the label printing routine in our
application. Specifically, I need to set the BottomOffset on all
bands (rows of labels), except the bottom one, which must have its
BottomOffset set to 0.

Any ideas on how to do this? I assume to put my code in the
DetailBand's BeforeGenerate event, but how do I determine when the
bottom-most detail band is the one that is firing?

Thanks,

Gene Weinbeck
genew_ @_ FundRaiserSoftware.com
FundRaiser Software

Comments

  • edited November 2004
    Hi Gene,

    There is no built in way to tell if you are printing the last detail band on
    a page, however, if you know the size of these labels, compared to the size
    of the paper you are using, you should be able to calculate how many labels
    you can fit on one page and then using this information find out when you
    are printing the last detail band. Below is a function Bill Todd posted on
    how to find the amount of labels per page.

    function TListRptForm.GetLabelsPerPage(LabelReport: TppReport): Integer;
    var
    PrinterSetup: TppPrinterSetup;
    begin
    PrinterSetup := LabelReport.PrinterSetup;

    Result := Trunc(((PrinterSetup.PaperHeight - PrinterSetup.MarginTop -
    PrinterSetup.MarginBottom) /
    (LabelReport.DetailBand.Height +
    LabelReport.DetailBand.BottomOffset)));
    Result := Result * LabelReport.Columns;
    end;


    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.