请选择 进入手机版 | 继续访问电脑版
 找回密码
 立即注册

QQ登录

只需一步,快速开始

muhuiru

社区贡献组

65

主题

203

帖子

580

积分

社区贡献组

积分
580

活字格认证

[已处理] 导出word异常

muhuiru
社区贡献组   /  发表于:2019-1-11 13:48  /   查看:2616  /  回复:1

本帖子中包含更多资源

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

x

1 个回复

倒序浏览
KearneyKang讲师达人认证 悬赏达人认证
超级版主   /  发表于:2019-1-11 18:30:52
沙发
您好,导出其他的格式可以正常导出吗?

你的项目是C/S端,还是B/S 端的 不同的平台导出方法不一样
C/S端导出Word的代码如下:
  1. // Provide the page report you want to render.
  2. GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport();
  3. GrapeCity.ActiveReports.Document.PageDocument reportDocument = new GrapeCity.ActiveReports.Document.PageDocument(report);

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

  7. // Provide settings for your rendering output.
  8. GrapeCity.ActiveReports.Export.Word.Page.Settings wordSetting = new GrapeCity.ActiveReports.Export.Word.Page.Settings();

  9. // Set the FileFormat property to .OOXML.
  10. wordSetting.FileFormat = GrapeCity.ActiveReports.Export.Word.Page.FileFormat.OOXML;

  11. // Set the rendering extension and render the report.
  12. GrapeCity.ActiveReports.Export.Word.Page.WordRenderingExtension wordRenderingExtension = new GrapeCity.ActiveReports.Export.Word.Page.WordRenderingExtension();
  13. GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));

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

  16. reportDocument.Render(wordRenderingExtension, outputProvider, wordSetting);     
复制代码
如果是用H5的方式渲染的报表,那么你可以参考这个博客:https://gcdn.grapecity.com.cn/fo ... &extra=page%3D1


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