Reporting services SSRS报告以编程方式重命名

Reporting services SSRS报告以编程方式重命名,reporting-services,Reporting Services,我需要在SSRS中重命名报告。我可以在VisualStudio中通过在解决方案资源管理器中重命名来手动完成,但由于某些要求,我需要避免手动方法。在SSRS 2008中,我们如何以编程方式重命名报告?我只能猜测您想要什么。我假设您不是在谈论报表查看器控件,您想更改流式传输到客户端的报表文件的名称? 您可以使用内容处置HTTP标头,如中所示: Response.BinaryWrite(localReport.Render(reportFormat, null, out mimeType,

我需要在SSRS中重命名报告。我可以在VisualStudio中通过在解决方案资源管理器中重命名来手动完成,但由于某些要求,我需要避免手动方法。在SSRS 2008中,我们如何以编程方式重命名报告?

我只能猜测您想要什么。我假设您不是在谈论报表查看器控件,您想更改流式传输到客户端的报表文件的名称? 您可以使用内容处置HTTP标头,如中所示:

Response.BinaryWrite(localReport.Render(reportFormat,
      null, out mimeType, out encoding, out filenameExtension,
      out streamids, out warnings));

switch (reportFormat) {
    case "Excel":
       Response.ContentType = "application/excel";
       Response.AddHeader("Content-Disposition", "attachment; filename="+_your name_);
       break;
    case "PDF":
....