您好,导出其他的格式可以正常导出吗?
你的项目是C/S端,还是B/S 端的 不同的平台导出方法不一样
C/S端导出Word的代码如下:
- // Provide the page report you want to render.
- GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport();
- GrapeCity.ActiveReports.Document.PageDocument reportDocument = new GrapeCity.ActiveReports.Document.PageDocument(report);
- // Create an output directory.
- System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyWord");
- outputDirectory.Create();
- // Provide settings for your rendering output.
- GrapeCity.ActiveReports.Export.Word.Page.Settings wordSetting = new GrapeCity.ActiveReports.Export.Word.Page.Settings();
- // Set the FileFormat property to .OOXML.
- wordSetting.FileFormat = GrapeCity.ActiveReports.Export.Word.Page.FileFormat.OOXML;
- // Set the rendering extension and render the report.
- GrapeCity.ActiveReports.Export.Word.Page.WordRenderingExtension wordRenderingExtension = new GrapeCity.ActiveReports.Export.Word.Page.WordRenderingExtension();
- GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));
- // Overwrite output file if it already exists.
- outputProvider.OverwriteOutputFile = true;
- reportDocument.Render(wordRenderingExtension, outputProvider, wordSetting);
复制代码 如果是用H5的方式渲染的报表,那么你可以参考这个博客:https://gcdn.grapecity.com.cn/fo ... &extra=page%3D1
|