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

Archived reports

edited April 2003 in Devices
Hi!!

For a project here at work we need to print invoices and store them to an
archive.
Now, for the people who didn't pay we have to print a reminder. The reminder
is the invoice with the text reminder added.

So my question is: is it possible to drawtext on an archived report? Or does
someone know a possiple sollution...

We use Delphi 6 and ReportBuilder 6.03!!

Best regards,
Vincent

Comments

  • edited April 2003
    It may be easier to regenerate the archives with a new TppLabel in the
    reports.

    We do not have a utility that adds draw commands to an archive file. To do
    this, first, you'll have to create a new class which is modeled after our
    archive reader class (TppArchiveReader). This will let you open the archive
    and stream it up into page objects. The archive has a header which is the
    page information, as each page has a different length in memory and the
    header has info on the position of the pages in the archive file, like a
    directory of sorts. There is code in the archive reader that reads the
    header. Once you can loop through the pages of the archive, you can
    manipulate the page objects by adding a TppDrawText object to the page. Then
    you will have to write the archive file back down to a file stream to file
    with the new draw commands added.

    uses
    ppDrwCmd;
    ...
    lDrawText := TppDrawText.Create(nil);
    lDrawText.Page := aPageObject;
    ...
    Set draw command measurements in microns.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited April 2003
    If regenerating the archive files is not an option and you decide to modify
    the Archive files, I can point out a few things to wathc out for. I built a
    utility that can reverse-engineer the RAF to the Designer, allow you to make
    changes and save it back to an RAF file an it was no easy task. The
    ArchiveReader unit does not contain sufficient information on the structure
    of the Archive and adding draw commands will present you with problems of
    re-syncing the the header.

    I would suggest another approach that would simplify things considerably.
    Add the label that contains the text that you want and set the Font Color to
    white so that it will not show on the report. The draw command will be
    generated but not seen (unless you print on colored paper). Then, write
    your utility (or logic) to read each page and find that draw text command
    and change the Font Color to black and add that page (and all other pages)
    to an output stream or you may even be able to write it back to the original
    stream. (I would have to check this). The idea here is that the draw
    command already exists and changing the Font Color will not change the size
    of the page and that way you will not have to re-calculate the position
    value in the header.

    Chuck Van Acker
    Alogent Corp.
  • edited April 2003
    > Add the label that contains the text that you want and set the Font Color
    to

    Good idea Chuck!


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited April 2003
    thanx....

This discussion has been closed.