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

How to get Data Out of Report

edited April 2002 in General
Hello All:

I have a set of routines which take a ReportBuilder report and send it
to a Printer via the use of Esc codes to allow for precise printing on a Dot
Matrix printer.

I execute the following code, then I scan each component and extract its
position and text, then use escape codes to print it on the printer.

lDevice := TppDevice.Create(fmReport);
lDevice.PageSetting := psLastPage; // See ppTypes
lDevice.Publisher := ppReport2.Publisher;
ppReport2.CachePages := True;
ppReport2.PrintToDevices;

Questions:

1) The above works for a 1 page report. What do I need to do to for
multiple page reports ???

2) If the report is a classic banded report with 20 or so rows, how
could I extract the text and position of each element in that page ???


Thank you.


Neil Huhta

Comments

  • edited April 2002
    1) The PageSetting property on the device should be psAll.

    2) You can loop through the page's DrawCommands and access the Top and Left
    properties of each draw command to get it's position. Access the Text
    property to get the text. Check that the draw command is indeed a text
    command ie.
    if (aDrawCommand is TppDrawText) ...

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.