Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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.

Cheers,
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: 1072 | Views in the last 30 days: 7
 
Related Articles
FORUM

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.

FORUM

How to change reportserver menu bar/parameter bar color

Reporting services menu bar/parameter bar color change

FORUM

Report Parameter

Problem report parameter!!!!

FORUM

Changing Parameter Default in Existing Report

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

FORUM

data parameters in matrix reports

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

 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones