Answered by:
How to create downloaded file name dynamically in SSRS reports

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)
- Proposed as answer by Qiuyun YuMicrosoft contingent staff Wednesday, May 11, 2016 9:59 AM
- Marked as answer by Qiuyun YuMicrosoft contingent staff Sunday, May 15, 2016 11:12 AM
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 YuQiuyun Yu
TechNet Community Support- Proposed as answer by Qiuyun YuMicrosoft contingent staff Wednesday, May 11, 2016 9:59 AM
- Marked as answer by Qiuyun YuMicrosoft contingent staff Sunday, May 15, 2016 11:13 AM
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 SSRSIf you have any question, please feel free to ask.
Best Regards,
Qiuyun YuQiuyun Yu
TechNet Community SupportFriday, 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)
- Proposed as answer by Qiuyun YuMicrosoft contingent staff Wednesday, May 11, 2016 9:59 AM
- Marked as answer by Qiuyun YuMicrosoft contingent staff Sunday, May 15, 2016 11:12 AM
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 YuQiuyun Yu
TechNet Community Support- Proposed as answer by Qiuyun YuMicrosoft contingent staff Wednesday, May 11, 2016 9:59 AM
- Marked as answer by Qiuyun YuMicrosoft contingent staff Sunday, May 15, 2016 11:13 AM
Monday, May 9, 2016 8:57 AM