VC FlexGrid导出Excel

上传者: lykwhy1126 | 上传时间: 2023-12-15 11:28:09 | 文件大小: 4.96MB | 文件类型: RAR
贡献给热爱学习的人 (示例中含有详细的代码及说明) 1、生成默认的基本对话框工程,工程名为ProjectX。 2、添加FlexGrid1控件:Ctrl+W打开类向导,工程->增加到工程->Components and Contols->Registered ActiveX Controls->Microsoft FlexGrid Control ,version6.0 ->Insert 3、为IDC_DATAGRID1关联变量m_FlexGrid1 4、Ctrl+W打开类向导,新建一个类,选择从Type Library添加。如果是Office 2003,添加的是Office安装路径下的Excel.exe (在Office 2000环境下添加的应该是Excel9.OLB) 。在弹出的Confirm Classes里选择_Application,Workbooks,_Workbook,Worksheets ,_Worksheet,Range ,Font 这几个类,并确定新生成的.CPP和.h文件的名称为Excel.cpp和Excel.h,然后确定。 5、添加类CColorButton:Ctrl+W打开类向导->点击Member Variables->Add Class->new->name:CColorButton Base Class:CButton->Ok 6、添加类CColorButton的成员函数DrawIten和PreSubclssWindow 7、添加ColorButton.h和ColorButton.cpp的实现代码 8、"导出Excel"按钮关联类型为CColorButton的变量(Vaiable Type:CColorButton):m_btn1 9、右键点击ProjectX resources->引入:文件类型选择所有文件,依次引入5个按钮位图,程序将自动添加5个位图资源,然后设置位图资源的属性。 10、在stdafx.h中添加导入ADO库 11、在ProjectXDlg.h中添加智能指针变量等。 12、在ProjectXDlg.cpp中添加头文件引用:#include "Excel.h" 13、在ProjectXDlg.cpp的OnInitDialog()中添加初始化代码等。 14、双击导出Excel按钮,添加单击响应函数及功能代码。

文件下载

资源详情

[{"title":"( 65 个子文件 4.96MB ) VC FlexGrid导出Excel","children":[{"title":"FlexGrid导出Excel","children":[{"title":"ProjectX.h <span style='color:#111;'> 1.31KB </span>","children":null,"spread":false},{"title":"ProjectX.plg <span style='color:#111;'> 1.26KB </span>","children":null,"spread":false},{"title":"student.mdb <span style='color:#111;'> 200.00KB </span>","children":null,"spread":false},{"title":"StdAfx.cpp <span style='color:#111;'> 210B </span>","children":null,"spread":false},{"title":"ProjectX.clw <span style='color:#111;'> 1.31KB </span>","children":null,"spread":false},{"title":"rowcursor.cpp <span style='color:#111;'> 500B </span>","children":null,"spread":false},{"title":"rowcursor.h <span style='color:#111;'> 1.09KB </span>","children":null,"spread":false},{"title":"msflexgrid.cpp <span style='color:#111;'> 28.67KB </span>","children":null,"spread":false},{"title":"font.h <span style='color:#111;'> 1.43KB </span>","children":null,"spread":false},{"title":"ProjectX.aps <span style='color:#111;'> 42.66KB </span>","children":null,"spread":false},{"title":"ProjectX.dsp <span style='color:#111;'> 5.97KB </span>","children":null,"spread":false},{"title":"ProjectX.opt <span style='color:#111;'> 54.50KB </span>","children":null,"spread":false},{"title":"excel.h <span style='color:#111;'> 45.61KB </span>","children":null,"spread":false},{"title":"ColorButton.h <span style='color:#111;'> 1.81KB </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"ProjectXDlg.obj <span style='color:#111;'> 104.14KB </span>","children":null,"spread":false},{"title":"ColorButton.sbr <span style='color:#111;'> 8.81KB </span>","children":null,"spread":false},{"title":"ProjectX.pdb <span style='color:#111;'> 1.06MB </span>","children":null,"spread":false},{"title":"vc60.pdb <span style='color:#111;'> 580.00KB </span>","children":null,"spread":false},{"title":"msflexgrid.sbr <span style='color:#111;'> 39.83KB </span>","children":null,"spread":false},{"title":"ProjectX.obj <span style='color:#111;'> 18.70KB </span>","children":null,"spread":false},{"title":"excel.sbr <span style='color:#111;'> 199.93KB </span>","children":null,"spread":false},{"title":"ProjectX.exe <span style='color:#111;'> 304.10KB </span>","children":null,"spread":false},{"title":"ProjectX.sbr <span style='color:#111;'> 17.45KB </span>","children":null,"spread":false},{"title":"excel.obj <span style='color:#111;'> 650.04KB </span>","children":null,"spread":false},{"title":"vc60.idb <span style='color:#111;'> 273.00KB </span>","children":null,"spread":false},{"title":"font.sbr <span style='color:#111;'> 7.16KB </span>","children":null,"spread":false},{"title":"msado15.tlh <span style='color:#111;'> 88.65KB </span>","children":null,"spread":false},{"title":"rowcursor.obj <span style='color:#111;'> 2.46KB </span>","children":null,"spread":false},{"title":"ProjectX.pch <span style='color:#111;'> 9.03MB </span>","children":null,"spread":false},{"title":"msado15.tli <span style='color:#111;'> 74.90KB </span>","children":null,"spread":false},{"title":"ProjectXDlg.sbr <span style='color:#111;'> 74.21KB </span>","children":null,"spread":false},{"title":"ProjectX.res <span style='color:#111;'> 23.61KB </span>","children":null,"spread":false},{"title":"font.obj <span style='color:#111;'> 13.38KB </span>","children":null,"spread":false},{"title":"msflexgrid.obj <span style='color:#111;'> 133.04KB </span>","children":null,"spread":false},{"title":"StdAfx.obj <span style='color:#111;'> 130.74KB </span>","children":null,"spread":false},{"title":"ProjectX.ilk <span style='color:#111;'> 995.16KB </span>","children":null,"spread":false},{"title":"picture.sbr <span style='color:#111;'> 5.82KB </span>","children":null,"spread":false},{"title":"rowcursor.sbr <span style='color:#111;'> 5.11KB </span>","children":null,"spread":false},{"title":"ColorButton.obj <span style='color:#111;'> 17.68KB </span>","children":null,"spread":false},{"title":"ProjectX.bsc <span style='color:#111;'> 5.97MB </span>","children":null,"spread":false},{"title":"StdAfx.sbr <span style='color:#111;'> 1.69MB </span>","children":null,"spread":false},{"title":"picture.obj <span style='color:#111;'> 6.10KB </span>","children":null,"spread":false}],"spread":false},{"title":"picture.cpp <span style='color:#111;'> 1.10KB </span>","children":null,"spread":false},{"title":"ReadMe.txt <span style='color:#111;'> 3.53KB </span>","children":null,"spread":false},{"title":"msflexgrid.h <span style='color:#111;'> 7.31KB </span>","children":null,"spread":false},{"title":"StdAfx.h <span style='color:#111;'> 1.15KB </span>","children":null,"spread":false},{"title":"ProjectX.dsw <span style='color:#111;'> 568B </span>","children":null,"spread":false},{"title":"Resource.h <span style='color:#111;'> 1.02KB </span>","children":null,"spread":false},{"title":"font.cpp <span style='color:#111;'> 2.05KB </span>","children":null,"spread":false},{"title":"ProjectXDlg.cpp <span style='color:#111;'> 11.96KB </span>","children":null,"spread":false},{"title":"excel.cpp <span style='color:#111;'> 170.65KB </span>","children":null,"spread":false},{"title":"picture.h <span style='color:#111;'> 1.26KB </span>","children":null,"spread":false},{"title":"ColorButton.cpp <span style='color:#111;'> 3.70KB </span>","children":null,"spread":false},{"title":"res","children":[{"title":"ProjectX.ico <span style='color:#111;'> 1.05KB </span>","children":null,"spread":false},{"title":"btn_down.bmp <span style='color:#111;'> 4.13KB </span>","children":null,"spread":false},{"title":"ProjectX.rc2 <span style='color:#111;'> 400B </span>","children":null,"spread":false},{"title":"btn_focus.bmp <span style='color:#111;'> 4.13KB </span>","children":null,"spread":false},{"title":"Thumbs.db <span style='color:#111;'> 10.50KB </span>","children":null,"spread":false},{"title":"btn_hover.bmp <span style='color:#111;'> 4.13KB </span>","children":null,"spread":false},{"title":"btn_normal.bmp <span style='color:#111;'> 4.13KB </span>","children":null,"spread":false},{"title":"btn_disable.bmp <span style='color:#111;'> 4.13KB </span>","children":null,"spread":false}],"spread":false},{"title":"ProjectX.ncb <span style='color:#111;'> 697.00KB </span>","children":null,"spread":false},{"title":"ProjectX.rc <span style='color:#111;'> 6.87KB </span>","children":null,"spread":false},{"title":"ProjectXDlg.h <span style='color:#111;'> 1.81KB </span>","children":null,"spread":false},{"title":"ProjectX.cpp <span style='color:#111;'> 2.04KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明