简体   繁体   English

SSRS 更改先前快照报告的执行日期

[英]SSRS Change Execution Date of Previous Snapshot Report

Originally, I was using the Now() function to write the execution date of my report in a header textbox.最初,我使用Now() function 在 header 文本框中写入报告的执行日期。

=WeekdayName(WeekDay(Now())) & ", " & Day(Now()) & " " & MonthName(Month(Now())) & " " & Year(Now())

However, when I set up daily snapshots on the server, this will return the current date (when I am viewing the report) instead of when the snapshot was created, eg a report snapshot from last week shots today's date, 8/18/2020, in the title.但是,当我在服务器上设置每日快照时,这将返回当前日期(当我查看报告时),而不是创建快照的时间,例如,上周的报告快照拍摄今天的日期,2020 年 8 月 18 日,在标题中。

I have changed it to use the global execution constant instead:我已将其更改为使用全局执行常量:

=WeekdayName(WeekDay(Globals!ExecutionTime)) & ", " & Day(Globals!ExecutionTime) & " " & MonthName(Month(Globals!ExecutionTime)) & " " & Year(Globals!ExecutionTime)

This seems to work as intended.这似乎按预期工作。 While this corrects my problem going forward, it does not fix the execution date in the header for previous snapshots.虽然这解决了我的问题,但它并没有修复 header 中以前快照的执行日期。

Is it possible for me to go back and correct those wrong dates on the previous snapshots?我可以返回 go 并更正以前快照中的错误日期吗?

EDIT:编辑:

The data in the tables changes daily, so re-running the report and manually changing the date to a previous time is will not work since the new run may have different data than the previous date.表格中的数据每天都在变化,因此重新运行报告并手动将日期更改为以前的时间是行不通的,因为新运行的数据可能与以前的日期不同。

I know I could easily download the report as Excel or Word and then change the output text in the header on a local version, but most people consume the PDF version of the report online / through email subscription, so I need to get the date on that changed on the server. I know I could easily download the report as Excel or Word and then change the output text in the header on a local version, but most people consume the PDF version of the report online / through email subscription, so I need to get the date on在服务器上发生了变化。

Create a date parameter for snapshot date.为快照日期创建日期参数。 And set it's default value with now() or global execution datetime.并使用 now() 或全局执行日期时间设置它的默认值。

Use that parameter in expression.在表达式中使用该参数。

When report auto generate it will take given default date.当报告自动生成时,它将采用给定的默认日期。

If you want to change snapshot date then execute the report manually by passing parameter with any date you want.如果您想更改快照日期,请通过传递您想要的任何日期的参数手动执行报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM