Load from blob
Hello. I use this code to put/get fastreport 3 file from blob fields.
To put:
To get:
But when it execute frxreport.loadfromstream it gives me: "invalid file format" on frxXML unit.
What Can I do?
To put:
frxreport.loadfromfile(' ... somefile.fr3');
with SQLComponent do
begin
       Close;
       SQL.Clear;
       SQL.Add(' UPDATE FORMULARIOS SET BINFORME = :informe ' +
           ' WHERE NCOD_FORMULARIO = 1');
       DocumentoStr := TMemoryStream.Create;
       DocumentoStr.Position:=0;
       frxReport.SaveToStream(DocumentoStr);
       ParamByName('informe').LoadFromStream(DocumentoStr);
       ExecQuery;
       DocumentoStr.Free;
end;
To get:
with SQLComponent do
begin
    SQL.Add(' SELECT BINFORME FROM FORMULARIOS WHERE ' +
           ' NCOD_FORMULARIO=1');
    Active := True;
    if fields[0].value <> null then
    begin
          DocumentoStr:=TMemoryStream.Create;
          DocumentoStr.Position:=0;
          TBlobField(FieldByName('binforme')).SaveToStream(DocumentoStr);
          frxReport.LoadFromStream(DocumentoStr);
          DocumentoStr.Free;
    end
    else Report.Clear;
end;
But when it execute frxreport.loadfromstream it gives me: "invalid file format" on frxXML unit.
What Can I do?
Comments
Thanks.