Loading FR3 files from database
To save the FR in Interbase-Blobfield I use this text in Delphi 6:
procedure TForm1.Button1Click(Sender: TObject);
begin
if not ibtransaction1.Active then ibtransaction1.StartTransaction;
ibsql3.ParamByName('document').LoadFromFile('test.fr3');
ibsql3.ExecQuery;
ibsql3.Close;
ibtransaction1.Commit;
end;
To load I edit this:
procedure TForm1.Button2Click(Sender: TObject);
var stream:tstream;
begin
stream:=ibdataset4.CreateBlobStream(ibdataset4.FieldByName('ausdruck'),bmread);
frxreport1.LoadFromstream(stream);
frxreport1.showreport;
stream.Free;
end;
By loading the report I receive the error: Invalid File format caused by the unit FrXXml. Where is the problem?
procedure TForm1.Button1Click(Sender: TObject);
begin
if not ibtransaction1.Active then ibtransaction1.StartTransaction;
ibsql3.ParamByName('document').LoadFromFile('test.fr3');
ibsql3.ExecQuery;
ibsql3.Close;
ibtransaction1.Commit;
end;
To load I edit this:
procedure TForm1.Button2Click(Sender: TObject);
var stream:tstream;
begin
stream:=ibdataset4.CreateBlobStream(ibdataset4.FieldByName('ausdruck'),bmread);
frxreport1.LoadFromstream(stream);
frxreport1.showreport;
stream.Free;
end;
By loading the report I receive the error: Invalid File format caused by the unit FrXXml. Where is the problem?
Comments
stream:=ibdataset4.CreateBlobStream(ibdataset4.FieldByName('ausdruck'),bmread);
stream.seek(0,soFromBeginning);frxreport1.LoadFromstream(stream);
I suppose that the stream that you use to load the report will be empty and I suggest you test this by saving the stream to file after filling it from the blobfield.
Wouldn't supprise me if this solves the problem.
Kind regards,
Teo