导出前从后面的代码更改默认名称 reportViewer asp.net Mvc

Change default name reportViewer asp.net Mvc from code behind before export

大家早上好, 在我的应用程序中 asp.net MVC rdlc 通过 reportViewer 报告表单。 格式的文件导出功能:pdf、xlsx、docx,默认情况下,分配 rdlc 文件的名称,因此,例如,如果我的 rdlc 文件名为 ReportPippo.rdlc,我将获得导出报告,具体取决于所选格式之一:ReportPippo.pdf、ReportPippo.xlsx、ReportPippo.docx。 是否可以通过不使用默认名称来动态更改文件名? 我想得到一些为文件名提供日期/时间的东西,这样每次打印时我都有一个不同的文件。 提前致谢。

您可以在运行时使用 LocalReport.DisplayName 属性 设置文件名。