张志峰的博客

水滴石川,积少成多。

导航

随笔分类 -  Delphi Excel

摘要:生成excel中的饼图var i,j,m,n,count1:integer; str:string; Jdate:tdatetime; channellist,potBstrtime,potEstrtime,Jchannelname:string; Rres:boolean; JSHR:double; Excelid,achart1,cell1,cell2,cell3,cell4,cellMiddle,Range1,Range2,series1:variant; ExRowsValue,ExRowsName,ExClos:Integer; ImagePage,dataPage:integer; 阅读全文

posted @ 2013-08-19 13:21 ╰★张志峰★╮ 阅读(1854) 评论(0) 推荐(0)

摘要:定义变量 Excelid:variant;1、创建OLE对象 try Excelid:=CreateOleObject( 'Excel.Application' ); except on Exception do raise exception.Create('无法创建Xls文件,请确认是否安装EXCEL') end; Excelid.Visible := false; //Excel显示设置 Excelid.WorkBooks.Add; //生成新的excel文件 BCount:=Excelid.Worksheets.count; //取得了excel的wor 阅读全文

posted @ 2013-08-19 13:20 ╰★张志峰★╮ 阅读(8514) 评论(0) 推荐(0)

摘要:用DELPHI操作EXCEL在DELPHI中显示EXCEL文件,可用以下简单代码做到。但要实用,则需进一步完善。var Form1: TForm1; EApp:variant;implementationuses ComObj, OleServer,Excel2000;{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);begin EApp:=CreateOleObject('Excel.Application'); Windows.SetParent(EApp.HWND,Panel1.Handle); EApp.W 阅读全文

posted @ 2013-08-19 13:18 ╰★张志峰★╮ 阅读(1192) 评论(0) 推荐(0)

摘要:Delphi Excel导入 的通用程序 .分类: delphi 2012-09-24 18:20 257人阅读 评论(0) 收藏 举报 exceldelphiinteger数据库c步骤:1 连excel(自己知道其格式,最好是没个字段在数据一一对应)2 读excel数据,填入到数据库我这里有个函数,实现把excel表格中数据导入数据库,在一条数据导入前判断数据库中是否有该数据,如果有,就不再导入该数据(避免重复),你可以参考下procedure TForm_qyxxcx.BitBtn2Click(Sender: TObject);VAR I,J:INTEGER; col,row:intege 阅读全文

posted @ 2013-05-24 13:54 ╰★张志峰★╮ 阅读(5295) 评论(0) 推荐(0)

摘要:Delphi Excel导入 的通用程序 .分类: delphi 2012-09-24 18:19 127人阅读 评论(0) 收藏 举报 exceldelphiintegerprocedure TForm1.btnClick(Sender: TObject);begin OpenDialog1.Title := '请选择正确的excel文件'; OpenDialog1.Filter := 'Excel(*.xls)|*.xls'; if OpenDialog1.Execute then edit1.Text := OpenDialog1.FileName;end 阅读全文

posted @ 2013-05-24 13:52 ╰★张志峰★╮ 阅读(2895) 评论(0) 推荐(0)