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

DBArchiveReader question

edited November 2003 in General
Is it still required that I save the report to a file before I load it into
a db? Looking at example 155, that's the way it is done. I would prefer
to be able to save straight from a report to the db, which is what I thought
it did, and is the reason I upgraded to 7.

Any help is appreciated.

--
Bobby

Comments

  • edited November 2003
    Hi Bobby,

    Sorry, this is a little confusing. We have a way to read Report Archives
    from a database but we do not have a built in way to write them. This is on
    our wish list for future enhancements. As for now, you will need to write
    to file and stream it to a BLOB field using the method described below (same
    as demo 155).

    ---------------------------------------------------
    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.