RDLC Report not showing Report name while export to any format in asp.net

2.1k views Asked by At

I am having a problem to find how to change the name of the file that is going to be exported from the Report Viewer.

I have been looking for a way of setting programaticaly this name, for example despite of my RDLC Report, i would like to set the name when is exported to "Report.pdf" or "Report.xls".

When i export file it shows just ".pdf" or ".xls", file name is missing here's my piece of code .

 ReportViewer2.LocalReport.DataSources.Clear();
 ReportViewer2.LocalReport.DataSources.Add(rdData);
 ReportViewer2.LocalReport.DataSources.Add(rdChart);
 ReportViewer2.LocalReport.EnableExternalImages = true;
 ReportViewer2.LocalReport.DisplayName ="MyReport";
 ReportViewer2.LocalReport.ReportPath = Server.MapPath("Reports/rptSystemUsage.rdlc");
 ReportViewer2.LocalReport.SetParameters(Parameters);
 ReportViewer2.LocalReport.Refresh();
1

There are 1 answers

1
Jon On

This issue was caused by an UpdatePanel. Moving the ReportViewer outside of the update panel resolved the problem.