新建一 DataSet , 并加入数据 : prepareTable
function TFrm_Print.CreateTableInMemory(const AFieldDefs:TFieldDefs):TDataSet;
var
TempTable:TClientDataSet;
begin
TempTable:=nil;
Result:=nil;
if AFieldDefsnil then
begin
try
TempTable:=TClientDataSet.Create(Application);
TempTable.FieldDefs.Assign(AFieldDefs);
TempTable.CreateDataSet;
Result:=(TempTable as TDataSet);
Except
if TempTablenil then
TempTable.Free;
...[ 查看全文 ]