reporting-services - 如何获取文件名中的当前日期?

标签 reporting-services ssrs-2008

我每天都通过 SSRS 生成报告。我试图在作业运行和创建文件时获取当前日期作为文件名。

喜欢这个 ID_report_03-31-2014

我尝试过 echo %date% %time% 和 @ExecutionTime 但不起作用

最佳答案

文件共享订阅的主要选项是将@timestamp 添加到文件名。

来自File Share Delivery in Reporting Services :

An alternative approach to creating unique files for every delivery is to include a timestamp in the file name. To do this, add the @timestamp variable to the file name (for example, CompanySales@timestamp). With this approach, the file name is unique by definition, so it will never be overwritten.

我不知道这是否正是您所追求的,因为它将包含时间组件,但就标准 SSRS 订阅而言,您的选择是有限的。

评论后编辑

您对此处的格式没有太多控制权。

在 MS 论坛上,其中一位支持者建议使用数据驱动订阅来获得更多控制:

Can we edit @timestamp variable in SSRS :

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

但这对我来说似乎是一个糟糕的选择,但却是我能看到的唯一建议。

关于reporting-services - 如何获取文件名中的当前日期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22823519/

相关文章:

ssrs-2008 - 如何在 SSRS 2008 中抑制空子报表

sql-server - 将仅订阅从 SSRS 2008 移动到 SSRS 2012

reporting-services - 是什么导致了我的 SSRS 图表中的范围参数错误?

reporting-services - 在SSRS中将多个报告分组为一个

reporting-services - 报告服务 : grouping rows with color

xml - 从 SSRS XML 数据源中选择属性

reporting-services - 当前季度日期参数 SSRS 的最后一天

ssrs-2008 - ssrs表达式拆分字符串可能吗?

sql - SSRS - Group_Concat 等效于使用表达式吗?

sql - 我的查询在 SQL 中有效,但在 SSRS 中无效