views:

3524

answers:

2

When I subscribe for a report, I may chose to have a subject like: @ReportName was executed at: @ExecutionTime

I would like a name like this: Your "@ReportName" report covering Sep 10 2008 - Sep 16 2008

Sep 10 2008 - Sep 16 2008 are values of the two report parameters: @DateFrom and @DateTo, respectively.

Can I specify something like @ReportParameters!DateFrom as my subject?

A: 

I don't believe anything other than those 2 parameters are available to report subscription emails (at least in SSRS 2005).

You may be able to do something via a data-driven subscription, but the values you want to use need to be in the data source used for the subscription data - SSRS is still not able to collect data in the report itself.

cori
+1  A: 

Check out this article. The author shows how to execute a data driven subscription from code and provides a stored procedure for doing so. The stored procedure allows you to specify the email body so if you know the report parameters before running the report you could populate them before calling the procedure. I'm not sure if his procedure covers email subjects, but perhaps you could take what he has done and modify it.

Also just found this MSDN forum post with a response from MSFT that this a data driven subscription is the way to accomplish this.

Rich