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

Save archive to a database

edited February 2004 in General
Hi.

I've noticed that ReportBuilder comes with TppDBArchiveReader, wich reads
an archived report from a table. But I can't figure out how to store the
archive in the database in the first place. I might try to generate the
archivefile first, and then store the file in a table. But I guess there
is an easier method?

Thanks in advance,
Arild Bøifot


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Comments

  • edited February 2004
    Hi Arild,

    ---------------------------------------------------
    Tech Tip: Loading an Archive File to a Blob
    (or memory stream)
    ---------------------------------------------------

    You can easily write a routine to take a .RAF file and
    load it into a blob field or a TMemoryStream:

    myFileStream := TFileStream.Create('myArhcive.RAF', fmOpenRead);

    myFileStream.Position := 0;
    myBlobField.LoadFromStream(myFileStream);

    myFileStream.Free;


    OR

    myMemoryStream := TMemoryStream.Create;

    {note: passing 0 as the second parameter will copy the entire stream}
    myMemoryStream.CopyFrom(myFileStream, 0);

    myMemoryStream.Free;

    --
    Best Regards,

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