FastReport & LoadFromStream

edited 11:31PM in FastReport 4.0
I have Delphi 6 and FastReport 4.9.106.
I write procedure:

procedure Test;
var
s_out: TMemoryStream;
begin
frxRRejBTP.LoadFromFile(testFR.fr3');
Query1.Open;

frxReport.Variables:=''''+'Test FR'+'''';
frxReport.ShowReport;

s_out:=TMemoryStream.Create;
s_out.Position:=0;
frxReport.SaveToStream(s_out);
frxReport2.LoadFromStream(s_out);

Query1.Close;
end;

and after procedure (LoadFromStream) FastReport raise error:
invalid file format

Thanks,
Sorgente

Comments

  • Anu de DeusAnu de Deus Hampshire, UK
    edited 11:31PM

    You misplaced "position := 0", this is the correct code:
      frxReport.SaveToStream(s_out);
      s_out.Position:=0;
      frxReport2.LoadFromStream(s_out);
    

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.