SQL Server Reporting Services 2005中的订阅参数

时间:2023-02-02 08:17:52

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

当我订阅报告时,我可能会选择以下主题:@ReportName在以下位置执行:@ExecutionTime

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

我想要一个这样的名字:你的“@ReportName”报告涵盖2008年9月10日 - 2008年9月16日

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

2008年9月10日 - 2008年9月16日是两个报告参数的值:@DateFrom和@DateTo。

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

我可以指定像@ReportParameters这样的东西!DateFrom作为我的主题吗?

2 个解决方案

#1


4  

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.

此外,刚刚在MSDN论坛上发布了MSFT的回复,这是一个数据驱动的订阅是实现这一目标的方法。

#2


0  

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

我不相信除了这2个参数之外的任何其他内容都可用于报告订阅电子邮件(至少在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.

您可以通过数据驱动的订阅执行某些操作,但是您要使用的值需要位于用于订阅数据的数据源中 - SSRS仍然无法在报表本身中收集数据。

#1


4  

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.

此外,刚刚在MSDN论坛上发布了MSFT的回复,这是一个数据驱动的订阅是实现这一目标的方法。

#2


0  

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

我不相信除了这2个参数之外的任何其他内容都可用于报告订阅电子邮件(至少在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.

您可以通过数据驱动的订阅执行某些操作,但是您要使用的值需要位于用于订阅数据的数据源中 - SSRS仍然无法在报表本身中收集数据。