delphi,TDBGridEh导出excel的问题
if ( DBGridEh1.DataSource.DataSet.Active) and (not DBGridEh1.DataSource.DataSet.IsEmpty) then
begin
SaveDialog1.FileName :='sss';
if SaveDialog1.Execute then
begin
case SaveDialog1.FilterIndex of
1: SaveDBGridEhToExportFile(TDBGridEhExportAsXLS, DBGridEh1,SaveDialog1.FileName + '.xls' ,TRUE);
2: SaveDBGridEhToExportFile(TDBGridEhExportAsCSV, DBGridEh1,SaveDialog1.FileName + '.xls' ,TRUE);
end;
ShowMessage('导出完毕!');
end
end
else
ShowMessage('记录为空!');
end;