还是这样吧,直接导入excel
begin
app:=createoleobject('excel.application');
work:=createoleobject('excel.sheet');
try
work:=app.workbooks.open('d:/xxx.xls');
query.first;
while not query.eof do
begin
app.sheets[1].cells[x,y]:=你的结果
query.next;
end;
finally
app.quit;
app:=unasigned;
end;
end;
如果是delphi5就更好了,方法类似
begin
excelapplication1.connect;
excelapplication1.works.add(null,0);
excelworkbook1.connectto(excelapplication1.workbooks[1]);
excelworksheet1.connectto(excelworkbook1.sheets[1] as _worksheet;
excelworksheet1.cells.item[x,y]:=xxxx;
end;
其他的就自己编吧