Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 subscription dynamic file name

Author  Topic 

schuhtl
Posting Yak Master

102 Posts

Posted - 2005-07-13 : 16:22:26
Is it possible to have a data driven subscription that delivers the report to a file share with a dynamic name? My report has a supvervisors name parameter and I need to have the report delivered to a share with the
supervisors name and then the report name....like.... JSmith_TestReprt.xls,
TWoods_TestReport.xls, etc....

jhermiz

3564 Posts

Posted - 2005-07-13 : 17:29:18
quote:
Originally posted by schuhtl

Is it possible to have a data driven subscription that delivers the report to a file share with a dynamic name? My report has a supvervisors name parameter and I need to have the report delivered to a share with the
supervisors name and then the report name....like.... JSmith_TestReprt.xls,
TWoods_TestReport.xls, etc....




Good question,

I am pretty certain you can use the Parameters class of the report to set the report name to that parameter, but I have left the office for the day.

I will see if I can whip up an example, and I will report back if I find anything that might be of interest to you.

Jon



Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]
Go to Top of Page

schuhtl
Posting Yak Master

102 Posts

Posted - 2005-07-14 : 11:06:33
Jon,

I created a subscription table and one of the columns I included was "ReportName". I then updated the column with my SuperviosrName + '_SupervisorReport'. When I created the data driven subscription "Step 4" I set the following options.

File Name > Get the value from the database = ReportName
Path > Get the value from the database = FileShare

Here is some sample data in case anyone needs to do something similar in the future....


CREATE TABLE SupervisorSubscription
(
[SupervisorName] [varchar] (50), --parameter name
[FileShare] [varchar] (200), --file destination
[ReportName] [varchar] (75) --file name
)
GO

INSERT INTO SupervisorSubscription (SupervisorName, FileShare, ReportName)
VALUES ('BJohnson', '\\SERVER1\Subscriptions', 'BJohnson_SupervisorReport')
GO

INSERT INTO SupervisorSubscription (SupervisorName, FileShare, ReportName)
VALUES ('Twoods', '\\SERVER1\Subscriptions', 'Twoods_SupervisorReport')
GO
Go to Top of Page
   

- Advertisement -