reporting-servicesssrs-2008ssrs-2012ssrs-2008-r2

Change default filename on export SSRS


Is there a way to change the default name of an SSRS export file to use current date?

by default when exporting to csv, excel, pdf, etc. the default name of report is the name of the report file (filename.rdl)

so when exporting to excel the default name is "filename.xlsx" how can I do it so it will export with current date or other parameter from the report?

this process is done manually by the user for exporting the file, so I need to do it without data drive subscription or similar, it should be a parameter to set on the report builder I believe.


Solution

  • Yes. By default, the name of the report will be the name of the RDL file. However, you can change the name of the report, and thus, the name of the exported file by setting the DisplayName property of the ReportViewer.LocalReport.DisplayName.

    this.ReportViewer1.LocalReport.DisplayName = $"My Report {DateTime.Now.ToString("MMM-dd-yyyy")}";