procedure BatchDBGridEhDataToExcel(DBGrid:TDBGridEh;Title:string;DrawGridLine:Boolean;
RangeFields:TStringList);
var
s:tstringlist;
i:integer;
begin
if not DBGrid.DataSource.DataSet.active then
begin
MessageDlg('主结果集没有打开!',mtWarning,[mbok],0);
exit;
end;
s:=tstringlist.create;
try
for i:=0 to DBGrid.Columns.Count-1do
begin
s.Add(DBGrid.Columns.FieldName);
DBGrid.DataSource.DataSet.FieldByName(
DBGrid.Columns.FieldName).DisplayLabel:=
DBGrid.Columns.Title.Caption;
end;
My_DataSetToExcel(DBGrid.DataSource.DataSet,s,RangeFields,DrawGridLine,true,
Title,'');
finally
s.free;
end;
end;
这个是网上COPY来的,My_DataSetToExcel过程在哪,是不是My_DataSetToExcelSheet过程,那又如何现多表头合并?回答出一样给分了