找回密码
 立即注册

QQ登录

只需一步,快速开始

susu1019

注册会员

1

主题

9

帖子

20

积分

注册会员

积分
20
最新发帖
susu1019
注册会员   /  发表于:2019-8-7 23:03  /   查看:5677  /  回复:13
              Activereports在wpf中进行导出时  能正常导出文件  但是导出完后 界面上的 报表显示报错  


                   分区集错误。请确认每个报表头/页头/分组头有对应的的报表尾/页脚/分组尾,并且有一个详细区。
                                 后台代码附上

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

13 个回复

倒序浏览
KearneyKang讲师达人认证 悬赏达人认证
超级版主   /  发表于:2019-8-8 09:08:50
沙发
您好!
你的报表文件在报表设计器里可以正常的预览吗?
回复 使用道具 举报
susu1019
注册会员   /  发表于:2019-8-8 09:54:54
板凳
KearneyKang 发表于 2019-8-8 09:08
您好!
你的报表文件在报表设计器里可以正常的预览吗?

今天连报表都不生成了  文件大小为0k
我是用的 动态绑定报表 在设计器里预览不出来
回复 使用道具 举报
KearneyKang讲师达人认证 悬赏达人认证
超级版主   /  发表于:2019-8-8 14:00:16
地板
您好,你换下面的导出的方式看看:
  1. // Provide the page report you want to render.
  2. GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport();GrapeCity.ActiveReports.Document.PageDocument reportDocument = new GrapeCity.ActiveReports.Document.PageDocument(report);

  3. // Create an output directory.
  4. System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyExcel");
  5. outputDirectory.Create();

  6. // Provide settings for your rendering output.
  7. GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings excelSetting = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings();
  8. excelSetting.FileFormat = GrapeCity.ActiveReports.Export.Excel.Page.FileFormat.Xls;
  9. GrapeCity.ActiveReports.Extensibility.Rendering.ISettings setting = excelSetting;

  10. // Set the rendering extension and render the report.
  11. GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension excelRenderingExtension = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension();
  12. GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));

  13. // Overwrite output file if it already exists.
  14. outputProvider.OverwriteOutputFile = true;

  15. reportDocument.Render(excelRenderingExtension, outputProvider, excelSetting.GetSettings());
复制代码

回复 使用道具 举报
susu1019
注册会员   /  发表于:2019-8-8 14:46:34
5#
KearneyKang 发表于 2019-8-8 14:00
您好,你换下面的导出的方式看看:

你好  导出来没有数据 我数据源应该在那句代码中加进去呀
回复 使用道具 举报
susu1019
注册会员   /  发表于:2019-8-8 14:56:03
6#
susu1019 发表于 2019-8-8 14:46
你好  导出来没有数据 我数据源应该在那句代码中加进去呀

走到最后一句话 报错  无法连接到数据源

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
susu1019
注册会员   /  发表于:2019-8-8 15:05:15
7#
这是代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
susu1019
注册会员   /  发表于:2019-8-8 15:05:43
8#

是还少了东西吗  报错无法连接数据源
回复 使用道具 举报
susu1019
注册会员   /  发表于:2019-8-8 15:06:25
9#
KearneyKang 发表于 2019-8-8 14:00
您好,你换下面的导出的方式看看:

报错无法连接数据源 是我代码中少了什么吗 您看看
回复 使用道具 举报
KearneyKang讲师达人认证 悬赏达人认证
超级版主   /  发表于:2019-8-8 16:10:36
10#
报无法连接数据源,这应该就是你的数据连接哪里存在问题。你在本地看看能不能正常运行,然后我们本地导出还有对应的demo
你可以参考对应示例库有导出Excel的你可以参考下:https://gcdn.grapecity.com.cn/fo ... &extra=page%3D1
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部