Winform 使用ActiveReport9导出Excel,打开的时候出现以下错误:
附件是报表文件和导出的Excel文件
导出代码以下:
//定义输出目录
System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(path);
outputDirectory.Create();
//定义导出设置
GrapeCity.ActiveReports.Export.Excel.Page.Settings excelSetting = new GrapeCity.ActiveReports.Export.Excel.Page.Settings();
//创建渲染机制
GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension excelRenderingExtension = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension();
//创建导出提供器
GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory,
System.IO.Path.GetFileNameWithoutExtension(path));
//导出
(_rptDocument as GrapeCity.ActiveReports.Document.PageDocument).Render(excelRenderingExtension, outputProvider, excelSetting);
|