Loading report at runtime: exception th second time report is prepared

edited 9:37PM in FastReport 4.0
if i do ...

1 loadreport...
2 preparereport <---- this works

3 loadreport...
4 preparereport <--- here i have an exception (only if step 3 is executed): could not convert variant of type (null) into type (olestr)

the loadreport method load a report from a database blob field and is like this:

procedure loadreport(rpt:TfrxReport;field:TField);
var
stream:TStream;
begin
stream:=field.dataset.CreateBlobStream(TBlobField(field),bmRead);//s1.size=16126
if stream=nil then exit;

try
rpt.LoadFromStream(stream);
stream.position:=0;
finally
stream.free;
end;
end;

any suggestion ?

thanks
Delphi XE6, Fastreport 4.15.13

Comments

  • edited 9:37PM
    solved

    i need to set again report.variables after the report is loaded the second time.

    Roberto

Leave a Comment