SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Report Subscription Dynamic File Names

By Mark Terry,

After much searching across the internet I have found that you could not set the name of the file you were attaching to dynamic report subscriptions in Microsoft Reporting Services. I did manage to find one article showing you how your could make a stored procedure to actually execute the report from, providing the parameters. However this only worked for one parameter, and was kind of a pain for a long term solution.

I found the core of this method was using the path in the catalog table. That is what the file name is based off of. So I have created the stored procedure below to be run every 15 minutes (you can change the timing) the change the path of the reports that were going to be generated in the next 15 minutes and to change back the path of any reports that were previously generated.

The only limitation of this is that you cannot access that report directly in the report server during that 15 minutes. However, you can alter the script to change this timeframe if you would like to limit that window.

Mark Terry

P.S. I have only tested this with Data Driven report subscriptions fully. This is more useful for email delivery as filebased you can just use parameters such as @TimeStamp for the filename.

Total article views: 1121 | Views in the last 30 days: 1
Related Articles

How can I change the word "NULL" in report parameter section for a nullable parameter?

Change "Null" to "Any" or "All" in Report Parameter Section.


How to change reportserver menu bar/parameter bar color

Reporting services menu bar/parameter bar color change


Report Parameter

Problem report parameter!!!!


Changing Parameter Default in Existing Report

After changing the default in BIDS, the change won't deploy to Report Manager.


data parameters in matrix reports

nedd to change the data parameters in the quiry and report properties