找回密码
 立即注册

QQ登录

只需一步,快速开始

zxx911

注册会员

3

主题

6

帖子

57

积分

注册会员

积分
57
最新发帖
zxx911
注册会员   /  发表于:2020-12-15 10:46  /   查看:2421  /  回复:1
导出EXCEL的文件名称在哪里可以修改?

1 个回复

倒序浏览
KearneyKang讲师达人认证 悬赏达人认证
超级版主   /  发表于:2020-12-15 17:24:32
沙发
你好,你是web端需要进行修改,还是C/S端需要进行导出修改
web端的导出代码设置
  1. viewer.export('XLSX', null, true, { FileName: '1997 Annual Report1', Multisheet: false,LayoutMode:"Galley" })
复制代码
C/S 端导出
  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:\MyExcel");
  6. outputDirectory.Create();

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

  11. // Set the rendering extension and render the report.
  12. GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension excelRenderingExtension = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension();
  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(excelRenderingExtension, outputProvider, setting.GetSettings());
复制代码


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