C# 在asp.net中导出为任何格式时,RDLC报表不显示报表名称

C# 在asp.net中导出为任何格式时,RDLC报表不显示报表名称,c#,asp.net,visual-studio-2005,rdlc,C#,Asp.net,Visual Studio 2005,Rdlc,我在查找如何更改将从报表查看器导出的文件的名称时遇到问题 我一直在寻找一种通过编程方式设置此名称的方法,例如,尽管我的RDLC报告存在问题,但我希望在导出到“Report.pdf”或“Report.xls”时设置名称 当我导出文件时,它只显示“.pdf”或“.xls”,文件名丢失。这是我的一段代码 ReportViewer2.LocalReport.DataSources.Clear(); ReportViewer2.LocalReport.DataSources.Add(rdData);

我在查找如何更改将从报表查看器导出的文件的名称时遇到问题

我一直在寻找一种通过编程方式设置此名称的方法,例如,尽管我的RDLC报告存在问题,但我希望在导出到“Report.pdf”或“Report.xls”时设置名称

当我导出文件时,它只显示“.pdf”或“.xls”,文件名丢失。这是我的一段代码

 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();

此问题是由
UpdatePanel
引起的。将
ReportViewer
移到更新面板之外解决了问题。

得到了解决方案,这是因为更新面板。将您的Reportviwer置于更新问题之外可以解决您的问题problem@user3168256,由于该解决方案已发布在评论中,因此我添加了一个社区wiki作为答案,以便其他人可以看到您找到了此问题的解决方案。:)