Problem with LoadFromSteram .. help

I charged at a table in my DB on a BLOB field that the XML report before it was saved with ... SaveToStream, the problem is that when using Reporte.LoadFromStream (VarStream) does not call the file properly, will be a BUG Version FR 4.7.5?

I check the following;
-Writes perfectly into the BLOB field

function that calls the Report:
Function TDataImpresion.BusFormato:Boolean;
Var
 Campo:TStream;
begin
  Archivo:='';
  Campo:=nil;
  Result:=False;
  Try
  FormaReporte.Open;
  FormaReporte.First;
  if FormaReporte.Reccoercount>0 Then
      Campo := FormaReporte.CreateBlobStream(FormaReporte.FieldByName('DISENO'), bmRead)
  if Campo.Size<>0 then
     Begin
     Campo.Position := 0;
     Reporte.Clear;
     Reporte.LoadFromStream(Campo);
     Reporte.ReportOptions.Description.Add(ReportesNOMBREPO.Value);
     Result:=True;
     end;
  Finally
     Campo.Free;
     FormaReporte.Close;
  End;
end;

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 3:02AM
    To save:
    stream := TMemoryStream.Create;
    TfrxReport.SaveToStream(stream);
    stream.Position := 0;
    (dataset.fieldByName('my_blob') as TBlobField).LoadFromStream(stream);

    To load:
    stream := TMemoryStream.Create;
    (dataset.fieldByName('my_blob') as TBlobField).SaveToStream(stream);
    stream.Position := 0;
    TfrxReport.LoadFromStream(stream);
  • edited 3:02AM
    gordk wrote: »
    To save:
    stream := TMemoryStream.Create;
    TfrxReport.SaveToStream(stream);
    stream.Position := 0;
    (dataset.fieldByName('my_blob') as TBlobField).LoadFromStream(stream);

    To load:
    stream := TMemoryStream.Create;
    (dataset.fieldByName('my_blob') as TBlobField).SaveToStream(stream);
    stream.Position := 0;
    TfrxReport.LoadFromStream(stream);

    Friend gordk

    This test and perform and still have the problem, apparently for what I think is when recording in the BLOB field, changes when you call something that is not the same .. could be the way they think the BLOB field in the table .. What would be the way correct?

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.