OLEObject FastReport

Hi
I am writing a program in Delphi 2010, but I need professional help. Program which I try to write is designed to create a report after filling form fields.
I have a problem with sending to the FastReport component Tolecontainer field values, which loads files for example MS Excel. The user can create a new worksheet MS Excel or filling an existing one.
The only thing I found in web is:

procedure TForm1.frxReport1AfterPrint(Sender: TfrxReportComponent);
var
a: TFileStream;
begin
a := TFileStream.create('C:\Users\piotr\Documents\wstep.doc', fmOpenRead);
OLE1.LoadFromStream(a);
end;


Unfortunately, this solution does not work. It displays ERROR:

"Project1.exe raised exception class EoleError witch message" Invalid stream format"

Please, can someone help?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.