locked
Dynamically name SSRS reports accoring to the parameter selected when exporting to PDF RRS feed

  • Question

  • Hi There,

    I am using SQL Server 2008 R2 standard

    Is there any way to dynamically change the name of the exported to PDF report for including the parameters in the name?

    For example, for the following SSRS parameters?

    Paramenter 1: Cars

    Paramenter 2: 2011

    Get the exported report named as: ReportName_Cars_2011.pdf

    Thanks and best regards,

    Joss

    Tuesday, April 3, 2012 10:28 AM

Answers

  • Hi Joss,

    This code is only applicable if you are using report viewer control in your application (web or windows) to display reports.

    If your are using SSRS in standalone way, there is no way to achive this.


    - Chintak (My Blog)

    • Proposed as answer by Sanjeewan Kumar Wednesday, April 4, 2012 9:00 AM
    • Marked as answer by Joss83 Wednesday, April 4, 2012 1:12 PM
    Tuesday, April 3, 2012 2:24 PM

All replies

  • Hi Joss,

    Are you using report viewer control then you can try doing this as mentioned below

    http://www.jimandkatrin.com/CodeBlog/post/Setting-export-file-name-in-SSRS-report-viewer.aspx

    ReportViewer1.ServerReport.DisplayName = filename


    - Chintak (My Blog)

    Tuesday, April 3, 2012 11:52 AM
  • Hi

    Try this code

    ReportViewer.ServerReport.DisplayName = <Your Parameter Value>;



    Hope this will help you !!!
    Sanjeewan

    Tuesday, April 3, 2012 12:04 PM
  • Can that code be used on the Code tab of the report properties within BIDS or should be used in a custom code application?

    Thanks for your answers and best regards,

    Joss

    Tuesday, April 3, 2012 12:55 PM
  • Hi Joss,

    This code is only applicable if you are using report viewer control in your application (web or windows) to display reports.

    If your are using SSRS in standalone way, there is no way to achive this.


    - Chintak (My Blog)

    • Proposed as answer by Sanjeewan Kumar Wednesday, April 4, 2012 9:00 AM
    • Marked as answer by Joss83 Wednesday, April 4, 2012 1:12 PM
    Tuesday, April 3, 2012 2:24 PM
  • Hi Chintak,

    Thanks for your clarification. Actually I am using SharePoint Performance Point Services to display the SSRS reports that I developed in BIDS.

    So as you said I think there is no way to include custom code behind, isn't it?

    Thanks and best regards,

    Jose 

    Tuesday, April 3, 2012 4:04 PM