M
Mrlong
Unregistered / Unconfirmed
GUEST, unregistred user!
我在frf文件已定义好打印的格式和数据源,现在动态作创建tfrDataSet出现错误
{FastReport}
if sProcessMode = '0' then
begin
frReport := TfrReport.Create(nil);
frDBDataSet := TfrDBDataSet.Create(nil);
try
frReport.LoadFromFile(sTemplateName);//加入.frf文件
frDBDataSet.DataSet := sDataSet;
//sDataSet是要打印的数据源
frReport.Dataset := frDBDataSet;
frReport.PrepareReport;
frReport.ShowReport;
finally
frReport.Free;
frDBDataSet.Free;
end;
{FastReport}
if sProcessMode = '0' then
begin
frReport := TfrReport.Create(nil);
frDBDataSet := TfrDBDataSet.Create(nil);
try
frReport.LoadFromFile(sTemplateName);//加入.frf文件
frDBDataSet.DataSet := sDataSet;
//sDataSet是要打印的数据源
frReport.Dataset := frDBDataSet;
frReport.PrepareReport;
frReport.ShowReport;
finally
frReport.Free;
frDBDataSet.Free;
end;