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?

Comments

  • edited 8:35AM
    try:

    stream:=ibdataset4.CreateBlobStream(ibdataset4.FieldByName('ausdruck'),bmread);
    stream.seek(0,soFromBeginning);frxreport1.LoadFromstream(stream);
  • FRNLFRNL Hoogeveen - Netherlands
    edited 8:35AM
    I notice that you don't use the blob field for saving the report (don't know your query, don't know ibSQL) and I can imagine that if you need a blobfield for loading the report from the database, you also need a blobfield to save it.

    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

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.