Sql-server – SSRS email subscription with custom file name on the attachment

sql-server-2008ssrs

I would like to set up an SSRS email subscription that attaches the report in PDF format to the email with a custom file name that changes daily. I was hopeful that I could to this via a data-driven subscription, but that does not seem possible. Does anyone have a handy work-around for this limitation?

UPDATE: @swasheck provided a decent work-around, and one that we currently use. But I am hoping to remove the step of saving to a file-share.

Best Answer

This is the first way I could think of to make this happen:

  1. Create a data-driven subscription for the report
  2. Specify Windows File Share as the delivery method (this would imply that you had a file share location available)
  3. Connect to a data source
  4. Write a query to generate the name
  5. Specify that name as the report name in the location of your file share
  6. Have a process by which the end-users are emailed this report - perhaps a SQL Agent job?

As a matter of personal exploration, I wonder if it'd be possible to modify the SQL Agent job that the subscription creates such that you could add a step to send the file via email.