Home > Back-end >  Delphi using DLL fastreport do memory error
Delphi using DLL fastreport do memory error

Time:09-21

As title, the following is the initialization function and fr3 screenshots, when showreport stringDS does not exist, please everyone a great god,
Procedure InitReport (const FileName: WideString);
Var
VBuffer: array [0.. MAX_PATH] of Char;
The begin
FrxReport:=TfrxReport. Create (nil);
FrxDesigner:=TfrxDesigner. Create (frxReport);
StringDS:=TfrxUserDataSet. Create (frxReport);

FrxReport. OnGetValue:=EvHandler. FrxReport1GetValue;
GetModuleFileName (HInstance, vBuffer, SizeOf (vBuffer));
FrxReport. LoadFromFile (ExtractFilePath (vBuffer) + FileName);
FrxReport. DataSets. The Add (StringDS);

MasterData1:=TFrxMasterData (frxReport FindObject (' MasterData1 '));
MasterData1. The DataSet:=StringDS;
FrxReport. Variables. The Clear;

//note!!!!! The first 'is inside a space!! If there are no Spaces, can't add correct classification
FrxReport. Variables. The Add. The Name:="' + 'Custom Variables';
End

Procedure ShowJsonReport;
The begin
StringDS. RangeEnd:=reCount;
StringDS. RangeEndCount:=rcount;
FrxReport. ShowReport;
end;


  • Related