社区
茶馆
帖子详情
怎样样将StringGrid 控件内的数据保存到*.txt,*.xls中
liujl9754
2002-03-22 10:19:38
保存到*.txt文件,但是怎么保存为*.xls文件.我是了很多方法还是不行,帮忙一下.
...全文
104
2
打赏
收藏
怎样样将StringGrid 控件内的数据保存到*.txt,*.xls中
保存到*.txt文件,但是怎么保存为*.xls文件.我是了很多方法还是不行,帮忙一下.
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
2 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
40Star
2002-03-22
打赏
举报
回复
StringGrid1->Rows->SaveToFile
kingcaiyao
2002-03-22
打赏
举报
回复
please see the following code:
//define in header file
#define OlePropertySet PS
#define OlePropertyGet PG
#define OleFunction FN
#define OleProcedure PR
.cpp File
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Variant V,WB1,SH1;
V=Variant::CreateObject("Excel.Application");
V.PS("Visible",true);
V.PG("WorkBooks").PR("Open","c:\\Chenbin\\BCB\\Excel\\Book1.xls");
WB1=V.PG("ActiveWorkBook");
SH1=WB1.PG("ActiveSheet");
CCEdit1->Text=SH1.PG("Cells",1,1).PG("Value");
for(int i=1;i<=RowCount;i++)
{
for(int j=1;j<=ColCount;j++)
{SH.PG("Cells",i,j).PS("Value",StringGrid->Cells[i-1][j-1]);
}
}
V.PR("Save");
//V.FN("Close");
V.PR("Quit");
V=Unassigned;
WB1=Unassigned;
SH1=Unassigned;
ShowMessage("The Excel application has been opened by BCB");
}
报表票据打印/建立SQL查询条件/
数据
功能扩张
该套
控件
操作极其简单,使用极其灵活,...2、报表设计器:wydReport.exe3、查询条件建立
控件
: 可建立含SQL条件4、LuckJump1
数据
功能扩张,含显示设置、
数据
查询、快速浏览、分组汇总、导出
数据
(.
xls
.htm .cvs .
txt
)
String
Grid
数据
导出到Excel
1、
控件
:
String
Grid
1: TRz
String
Grid
; ADOConnection1: TADOConnection; ADOTable1: TADOTable; DataSource1: TDataSource; Button1: TButton;//导出
数据
Button2: TButton;//连接
数据
库 But...
【Delphi】将T
String
Grid
控件
中
的
数据
按照所选路径
保存
成Excel文件
前两篇研究了一下T
String
Grid
控件
在连接
数据
库后,
数据
的填充。还有T
String
Grid
中
的填充
数据
复制到...现在,再来研究一下,如何把当前T
String
Grid
控件
中
的
数据
整表
保存
成Excel文件,并将Excel文件
保存
到所选路径。 ...
delphi10.4.2
中
用
XLS
ReadWriteII5
控件
将
数据
库导入导出EXCEL
现用
XLS
ReadWriteII5
控件
非常方便,代码如下所示: unit Umain; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl....
从Excel导入信息在
String
Grid
显示
1、
控件
:2个Button,1个label,1个edit,1个
String
Grid
,1个OpenDialog,1个PopuMenu 2、双击‘......’按钮,选择文件路径 1 //打开指定的文件 2 OpenDialog1.InitialDir := ExtractFilePath(Application...
茶馆
552
社区成员
20,062
社区内容
发帖
与我相关
我的任务
茶馆
C++ Builder 茶馆
复制链接
扫一扫
分享
社区描述
C++ Builder 茶馆
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章