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

Report Archive File to Stream

edited February 2002 in General
Hi,

Is there any way to save a report in archive file format to a memory stream
variable? TExtraDevices will let you save to stream but only for the
TExtraDevices device types.

Natalie

Comments

  • edited February 2002
    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;


    Cheers,

    Jim Bennett
    Digital Metaphors Corp



  • edited February 2002
    Hi Jim,

    I was trying to not have to write out a file. It's a web application and
    directory rights get a little sticky. I am doing exactly what you suggest
    below right now, but was hoping to not to have to give my web user write
    access to a certain folder.

    Thanks,
    Natalie


This discussion has been closed.