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

Traversing dataset again once printed

edited August 2004 in RAP
We have RB templates that print letters to different people e.g. reminders
that an existing permit needs renewing...

When the letters have been printed we want to be able to update various
records in the database to denote that the reminder letters have been sent.

We have written pass-through functions for updating the various records in
the database and this is working fine on other templates where we only ever
print one record (we have put the code in the ReportAfterPrint event).

Now we want to do the same when multiple records are printed. As the
templates are 'stand-alone', we must do whatever is necessary in RAP WITHIN
the report itself - we cannot do it externally.

My question is, having run the report and checked to see if it was printed
OK, how can we then traverse through the data a second time and run our
pass-though functions to do an update for each record we have printed (and
not print the letters a second time!).

If DM can provide some sample code of how to do this, it would be very much
appreciated!

Regards,

Pete Colson.

Comments

  • edited August 2004

    First try to implement something using Delphi code and then convert it to
    RAP pass-thru functions. My first try would be to traverse the records in
    the report.DataPipeline.

    lDataPipeline := myReport.DatatPipeline;

    lDataPipeline.First;
    while not lDataPipeline.Eof do
    begin
    lDataPipeline.Edit;
    lDatgaPipeline['LastPrinted'] := Now;
    lDataPipeline.Post;

    lDataPipeline.Next;

    end;



    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2004
    Thanks, Nard,

    Have written pass-thu functions to do First and Next to the data pipeline,
    and it now works a treat...

    Regards,

    Pete Colson


This discussion has been closed.