如題,下面是初始化函式和fr3截圖,在showreport的時候報stringDS不存在。求各位大神指點。
procedure InitReport(const FileName: WideString);
var
vBuffer: array[0..MAX_PATH] of Char;
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.Add(StringDS);
MasterData1:=TFrxMasterData(frxReport.FindObject('MasterData1'));
MasterData1.DataSet:=StringDS;
frxReport.Variables.Clear;
//注意!!第一個' '內是一個空格!!如果沒有空格,不能正確添加分類
frxReport.Variables.Add.Name:=' '+'Custom variables';
end
procedure ShowJsonReport;
begin
StringDS.RangeEnd := reCount;
StringDS.RangeEndCount := rcount;
frxReport.ShowReport;
end;
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/63139.html
標籤:VCL組件開發及應用
下一篇:Delphi7下讀取QQ聊天內容
