WebForms的ReportViewer提供了导出成EXCEL或者PDF的报表。
但是导出时报表会另存为.xls[1] 或者 .pdf[1],导致文件无法直接打开。
这需要给ReportViewer设定一个DisplayName解决。
ReportViewer1.LocalReport.DisplayName = "REPORT_" + DateTime.Now.ToShortDateString();
本文介绍了使用WebForms的ReportViewer组件导出报表时遇到的问题:导出的文件名默认带有特殊字符,导致文件无法正常打开。文章提供了解决方案,通过设置ReportViewer的DisplayName属性来自定义文件名。
WebForms的ReportViewer提供了导出成EXCEL或者PDF的报表。
但是导出时报表会另存为.xls[1] 或者 .pdf[1],导致文件无法直接打开。
这需要给ReportViewer设定一个DisplayName解决。
ReportViewer1.LocalReport.DisplayName = "REPORT_" + DateTime.Now.ToShortDateString();
4565

被折叠的 条评论
为什么被折叠?