帮忙!!!!!!!!!!!!!!!!!!!!!!!!在线! 有谁能给我一段例子!关于在delphi中调用excel的.并把数据库要显示的值在excel中显示出来.也就是输出报表用excel来输出. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 procedure TSearchanger_Form.BitBtn2Click(Sender: TObject);var ExcelID: Variant; Rcol: integer;begin ExcelID := CreateOleObject('Excel.Application'); ExcelID.Visible := True; ExcelID.Caption := '应用程序调用 Microsoft Excel'; ExcelID.WorkBooks.Add; ExcelID.Cells[1, 1].Value := '摊位号'; ExcelID.Cells[1, 2].Value := '单位名称'; ExcelID.Cells[1, 3].Value := '单位代码'; ExcelID.Cells[1, 4].Value := '单位体制'; ExcelID.Cells[1, 5].Value := '法人'; query_new.close; query_new.sql.clear; query_new.sql.add ('Select * From khu'); query_new.Prepare; query_new.Open; Rcol := 2 ; query_new.First; While not query_new.Eof Do begin ExcelID.Cells[Rcol, 1].Value := query_new.FieldByName('摊位号').asstring; ExcelID.Cells[Rcol, 2].Value := query_new.FieldByName('单位名称').asstring; ExcelID.Cells[Rcol, 3].Value := query_new.FieldByName('单位代码').asstring; ExcelID.Cells[Rcol, 4].Value := query_new.FieldByName('单位体制').asstring; ExcelID.Cells[Rcol, 5].Value := query_new.FieldByName('法人').asstring; inc(Rcol); query_new.Next; end; 如何获取一个文件的详细信息? TDBGrideh和TDBLOOKUPCOMBOBXEH的使用! 还是判断条件,不重复执行同一个存储过程的问题。 求"Delphi第三方控件使用大全"的电子书及序列号 如何在delphi 2005 中如何使用水晶报表? 能在DbGridEh中实现以下功能? 无法使用程序员合订本随盘赠送的Delphi 7 特别版 急救!! 请求帮助:数据库问题 菜鸟提问???请高手帮忙!! 出售源代码!!!!!!! 数据集问题,高手请进! 谁发 dsgnintf 谁得50分
var
ExcelID: Variant;
Rcol: integer;
begin
ExcelID := CreateOleObject('Excel.Application');
ExcelID.Visible := True;
ExcelID.Caption := '应用程序调用 Microsoft Excel';
ExcelID.WorkBooks.Add;
ExcelID.Cells[1, 1].Value := '摊位号';
ExcelID.Cells[1, 2].Value := '单位名称';
ExcelID.Cells[1, 3].Value := '单位代码';
ExcelID.Cells[1, 4].Value := '单位体制';
ExcelID.Cells[1, 5].Value := '法人';
query_new.close;
query_new.sql.clear;
query_new.sql.add ('Select * From khu');
query_new.Prepare;
query_new.Open; Rcol := 2 ;
query_new.First;
While not query_new.Eof Do
begin
ExcelID.Cells[Rcol, 1].Value := query_new.FieldByName('摊位号').asstring;
ExcelID.Cells[Rcol, 2].Value := query_new.FieldByName('单位名称').asstring;
ExcelID.Cells[Rcol, 3].Value := query_new.FieldByName('单位代码').asstring;
ExcelID.Cells[Rcol, 4].Value := query_new.FieldByName('单位体制').asstring;
ExcelID.Cells[Rcol, 5].Value := query_new.FieldByName('法人').asstring;
inc(Rcol); query_new.Next;
end;