惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
Tenable Blog
Project Zero
Project Zero
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
S
Schneier on Security
Scott Helme
Scott Helme
S
Securelist
Know Your Adversary
Know Your Adversary
Vercel News
Vercel News
IT之家
IT之家
V
V2EX
F
Fortinet All Blogs
Simon Willison's Weblog
Simon Willison's Weblog
K
Kaspersky official blog
博客园_首页
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
Spread Privacy
Spread Privacy
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
有赞技术团队
有赞技术团队
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
L
LINUX DO - 热门话题
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
S
SegmentFault 最新的问题
AWS News Blog
AWS News Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost

博客园 - 张伦

Entity Framework 自动生成代码 如何用继承 PostMessage和SendMessage有什么区别? 正则表达式之日期类型(匹配闰年) C语言随记 - 张伦 - 博客园 Delphi 进制转换——十六进制 to 十进制浮点数 Modbus通讯类(Delphi) 未曾清贫难成人 C#sql查询导出为excel文件,并最终释放excel资源。 水晶报表ReportViewer之“创建控件错误” 什么是RFID matlab生成exe,含gui图形界面 EVC中int与string的相互转化 什么是嵌入式操作系统? WinCE和PocketPC的异同 Delphi中MSComm控件的安装(Licenses information for TMSComm not found) ARM是什么? 创建型设计模式分类 什么是设计模式? ASP.NET:创建对话框
Delphi中数据集导出为Excel
张伦 · 2006-05-25 · via 博客园 - 张伦

uses Excel97;
procedure ExcelOut;
var workbook,sheet:variant;
      xlapp,q:variant;
begin

  xlapp:=GetExcelObject('Excel.Application');
   xlapp.visible:=true;  //此属性为true,导出时会打开一个Excel文件,看到一行一行的写入数据
    
    if xlapp.workbooks.count<=0 then
      xlapp.workbooks.add;

    xlapp.worksheets.add;
    sheet:=xlapp.ActiveWorkBook.activesheet;

  sheet.cells[1,6].font.color:=clgreen;//单元格字体颜色
   sheet.cells[1,6].font.size:=20;//单元格字体大小
    sheet.cells[1,6].font.bold:=true;//单元格字体样式
    sheet.cells[1,6]:='表头'; //单元格内容

    sheet.rows[5].font.bold:=true;//设置整行字体样式
    sheet.rows[5].HorizontalAlignment := xlCenter;//设置整行每单元格内容居中
    sheet.rows[5].Interior.Color:=clyellow;//设置整行背景色

    q:=sheet.Range['A3','W5'];
    q.borders.linestyle:=1;//设置某一区域边框可见

    q:=sheet.Range['B3','E3'];
    q.Merge;//合并单元格B3--E3

   xlapp.ActiveWorkBook.SaveAs(savedialog1.FileName);//保存文件
    xlapp.ActiveWorkBook.close;
    xlapp.quit;//关闭退出,否则线程里会留下Excel.exe
 
end;