Variables to input in file name for Reporting Services subscriptions

南楼画角 提交于 2019-12-10 21:16:08

问题


Is there a list anywhere that lists all the variables I can use in file names for report subscriptions from within SQL Server Management Studio? I currently use @timestamp in my file names, but would like to use other options or even remove parts of the time stamp (for example, just use the date, not the time).


回答1:


Unfortunately @timestamp is the only variable available. There are various workarounds for formatting @timestamp, but nothing that is simple. Here is a thread that explains one (but not the only) workaround: http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/81f47009-946a-4ebc-be43-7690236e829b

In case that link goes away, here were the recommendations:

To solve the issue, I would suggest using Data-Driven Subscription

A data-driven subscription provides a way to use dynamic subscription data that is retrieved from an external data source at run time. A data-driven subscription can also use static text and default values that you specify when the subscription is defined. We can use data-driven subscriptions to do the following:

Distribute a report to a fluctuating list of subscribers. For example, you can use data-driven subscriptions to distribute a report throughout a large organization where subscribers vary from one month to the next, or use other criteria that determines group membership from an existing set of users. Filter the report output using report parameter values that are retrieved at run time. Vary report output formats and delivery options for each report delivery. .

In this case, we can define the filename with timestamp in database and then use Data-Driven Subscriptions to delivey the report.

For more information about Data-Driven Subscriptions, please see:

For SQL Server Reporting Services 2005: http://msdn.microsoft.com/en-us/library/ms159150(SQL.90).aspx

For SQL Server Reporting Services 2008: http://msdn.microsoft.com/en-us/library/ms159150.aspx



来源:https://stackoverflow.com/questions/3039474/variables-to-input-in-file-name-for-reporting-services-subscriptions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!