我每天都通过 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/