UNIGUI下载文件

UNIGUI下载文件

procedure exportXLS(dataset: TDataSet);
var
xls: TDataset2Excel;
f: string;
begin
if dataset = nil then
Exit;
f := '1.xls';
xls := TDataset2Excel.Create(nil);
try
xls.Dataset := dataset;
xls.WorksheetName := '1';
xls.SaveDatasetAs(f);
xls.Workbook := nil;
MainForm.uniApplication.UniSession.SendFile(f, f);
finally
xls.Free;
end;
end;

posted @ 2018-03-11 09:04  delphi中间件  阅读(2106)  评论(0编辑  收藏  举报