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

Any way to get track of the absolute postion on a 'printing' page?

edited November 2005 in General
Hi,

I need to print a vertical line on each page printed. The report consists of
multiple subreports. The height of the line can be different on each page. I
placed the vertical line on the reports PageStyle, its top is fixed, only
the height needs to be calculated.
Is it possible to get track of the absolute postion on a page after its
footerband fi is done printing and use that position as reference to calc
the height of the vertical line? Would this work or is there an easier way?

Greetings,
Filip Moons

Comments

  • edited November 2005
    Hi Filip,

    This may be possible during the first pass of the report. Where exactly
    would you like to measure to?

    --
    Regards,

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

    Best Regards,

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


    The last band printed on each page is a ppGroupFooterBand, so if i can get
    the postion on the page after that band is printed that would be nice. All
    my reports involved 'units' are set to 'utMMThousandths'.

    Greetings,
    Filip Moons

  • edited November 2005
    Hi Filip,

    Try checking the Report.Engine.PrintPosRect.Top property inside the
    GroupFooterBand.AfterPrint event. This should give you the value of the
    vertical position just after the band in microns.

    --
    Regards,

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

    Best Regards,

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

    Could u please reply...

    Thank you

  • edited November 2005
    I tried that yesterday already, that doesn't work. It always returns the
    same value (6350) for every page and the GroupFooterBand's location is
    different for every page

    showmessage(IntToStr(rptLYACT.Engine.PrintPosRect.Top));




  • edited November 2005
    6350 = top + height of last ppComponent to print in that band = bottom
    position of the engine within the band, i wanted absolute positioning.
    Bottom position of the engine within the page at a given moment

  • edited December 2005
    Hi Filip,

    In my testing the following code correctly added a vertical line to the
    report that dynamically altered its size according to the position of the
    group footer.

    procedure TForm1.ppGroupFooterBand1AfterPrint(Sender: TObject);
    var
    liCurrentPosition: Integer;
    lDrawLine: TppDrawLine;
    begin

    liCurrentPosition := ppReport1.Engine.PrintPosRect.Top;

    lDrawLine := TppDrawLine.Create(self);
    lDrawLine.Page := ppReport1.Engine.Page;
    lDrawLine.LinePosition := lpRight;
    lDrawLine.Left := ppReport1.PrinterSetup.PageDef.mmMarginLeft;
    lDrawLine.Top := ppReport1.PrinterSetup.PageDef.mmMarginTop;
    lDrawLine.Width := 4000;
    lDrawLine.Height := liCurrentPosition;

    end;

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2005
    Ok, finally got it working. I was using mainreport.Engine.PrintPosRect.Top
    instead of the childreport.Engine.PrintPosRect.Top to which the
    ppGroupFooterBand belonged.

    Thanks for the info.

    Greetings,
    Filip Moons

This discussion has been closed.