FastReport & LoadFromStream
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
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
You misplaced "position := 0", this is the correct code: