locked
How to create downloaded file name dynamically in SSRS reports RRS feed

  • Question

  • I am getting values through procedures. I have option to download files from SSRS report excel or pdf format. Based on the values I have to set file name dynamically in SSRS report. How we have to implement?

    • Edited by SQL MSBI Thursday, May 5, 2016 12:01 PM
    Thursday, May 5, 2016 12:00 PM

Answers

  • Hi ,

    Try this code

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

    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.

    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question. Enjoyed my post? Hit the up arrow (left)

    Friday, May 6, 2016 4:43 AM
  • Hi SSRS 2008 R2,

    If ProcessingMode is Local, please set the name through the DisplayName property suggested by Madhan. Please take a look at this same thread: Dynamically create filename in SSRS 2008.

    Best Regards,
    Qiuyun Yu


    Qiuyun Yu
    TechNet Community Support


    Monday, May 9, 2016 8:57 AM

All replies

  • Hi SSRS 2008 R2,

    Based on my understanding, the stored procedure contains a filed for file name. You want to export reports based this field to get dynamically file name, right?

    In your scenario, you can create a data driven subscription with Windows File Share delivery extension, then specify File name with the field from the procedure. For more information, please refer to links below:

    Lesson 3: Defining a Data-Driven Subscription
    Data-driven Subscriptions in SSRS

    If you have any question, please feel free to ask.

    Best Regards,
    Qiuyun Yu


    Qiuyun Yu
    TechNet Community Support


    Friday, May 6, 2016 2:23 AM
  • Hi Qiuyun,

    You are correct. I need to give file name based on the values in procedures. We deployed the report in dot net application. From there we generate the SSRS report. From SSRS reports, user can download report as pdf, excel etc. After generating the report, if user download the report as excel/pdf, I have to give file name dynamically. In subscription, it is generated on scheduled basis right. But I need this while user downloading report.


    • Edited by SQL MSBI Friday, May 6, 2016 3:43 AM
    Friday, May 6, 2016 3:43 AM
  • Hi ,

    Try this code

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

    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.

    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question. Enjoyed my post? Hit the up arrow (left)

    Friday, May 6, 2016 4:43 AM
  • Hi SSRS 2008 R2,

    If ProcessingMode is Local, please set the name through the DisplayName property suggested by Madhan. Please take a look at this same thread: Dynamically create filename in SSRS 2008.

    Best Regards,
    Qiuyun Yu


    Qiuyun Yu
    TechNet Community Support


    Monday, May 9, 2016 8:57 AM