找回密码
 立即注册

QQ登录

只需一步,快速开始

thunfeid

金牌服务用户

5

主题

23

帖子

221

积分

金牌服务用户

积分
221

微信认证勋章

最新发帖
thunfeid
金牌服务用户   /  发表于:2018-6-11 12:54  /   查看:2500  /  回复:1
WPF平台AR11


代码:
string dir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);//系统桌面路径
string filename = "导出文件.xls";
GrapeCity.ActiveReports.Export.Excel.Section.XlsExport xlsexpt = new XlsExport();
xlsexpt.FileFormat = FileFormat.Xlsx;
xlsexpt.UseCellMerging = true; //合并单元格,所见即所得
GrapeCity.ActiveReports.SectionReport RPT = 区域报表实例;
xlsexpt.Export(RPT.Document, dir + "\\" + filename);
Process.Start("explorer.exe", dir); //打开生成的文件夹

评分

参与人数 1金币 +500 收起 理由
KearneyKang + 500 赞一个!

查看全部评分

1 个回复

倒序浏览
KearneyKang讲师达人认证 悬赏达人认证
超级版主   /  发表于:2018-6-11 13:04:07
沙发
这波区域报表的导出Excel的代码贴的很到位。赞一个
区域报表导出Excel的核心代码:
  1. SectionReport1 rpt = new SectionReport1();
  2.             GrapeCity.ActiveReports.Export.Excel.Section.XlsExport XlsExport1 = new GrapeCity.ActiveReports.Export.Excel.Section.XlsExport();
  3.             // Set a file format of the exported excel file to Xlsx to support Microsoft Excel 2007 and newer versions.
  4.             XlsExport1.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx;
  5.             XlsExport1.Export(rpt.Document, Application.StartupPath + "\\XLSExpt.xlsx");
复制代码



评分

参与人数 1满意度 +5 收起 理由
thunfeid + 5 很给力!

查看全部评分

回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部