简体   繁体   中英

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.

=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.

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.

Is it possible for me to go back and correct those wrong dates on the previous snapshots?

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.

Create a date parameter for snapshot date. And set it's default value with now() or global execution datetime.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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