duyiduo 发表于 2016-2-11 17:01:00

ActiveReports 在 WPF中怎么导出 excel

ActiveReports在 WPF中怎么导出 excel,求列子
还有就是如何在GrapeCity.ActiveReports.Viewer.Wpf.View.Viewer中获取SectionDocument

Lenka.Guo 发表于 2016-2-14 10:34:00

抱歉,由于放假原因,未能及时回复您;
WPF 中导出Excel 核心代码如下,示例程序见附件 :

SectionReport1 sc = new SectionReport1();
            sc.Run();
            GrapeCity.ActiveReports.Export.Excel.Section.XlsExport XlsExport1 = new GrapeCity.ActiveReports.Export.Excel.Section.XlsExport();
            XlsExport1.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx;
            XlsExport1.Export(sc.Document, System.IO.Directory.GetCurrentDirectory() + "\\XLSExpt.xlsx"); //导出到Debug目录
            viewer1.LoadDocument(sc);

duyiduo 发表于 2016-8-29 11:06:55

这个方法不具有通用性,

Lenka.Guo 发表于 2016-8-29 12:10:43

您说的“不通用”具体指的是什么?
您可以参考博客: http://blog.gcpowertools.com.cn/post/2016/07/29/exportreport.aspx;主要讲解了三种报表类型使用Export Filters导出。
页: [1]
查看完整版本: ActiveReports 在 WPF中怎么导出 excel