在很多的時候
在此做一個示例以方便說明
步驟是
本方法的優點在於
function ToExcel():boolean;
var
y :integer;
tsList :TStringList;
s :string;
aSheet :Variant;
begin
result:=true;
Excel
Excel
Excel
aSheet:=excel
tsList:=TStringList
try
try
with qryMaster do
begin
Open;
First;
While Not Eof do
begin
s:=
for y:=
begin
s:=s+Fields[y]
Application
end;
tsList
// 從表
if qryDetail<>nil then
begin
with qryDetail do
begin
Open;
First;
while Not Eof do
begin
s:=
for y:=
begin
s:=s+Fields[y]
Application
end;
tsList
next;
end;
end;
end;
next;
end;
Close;
end;
Clipboard
except
result:=false;
end;
finally
tsList
end;
Excel
aSheet
MessageBox(Application
end;
From:http://tw.wingwit.com/Article/program/Delphi/201311/25012.html