SSRS: Showing the correct execution time on a two page report?

后端 未结 6 1196
萌比男神i
萌比男神i 2021-01-05 06:20

I\'m just wondering how I can show the correct execution time on a report?

Until recently I had been using the following in the footer of my reports as a label expre

6条回答
  •  借酒劲吻你
    2021-01-05 06:58

    The most efficient way of doing this is to create a user-defined variable which holds the value in memory and then invoke it each time within your text box.

    1. Right click on the report design pane (empty space) > Report Properties.
    2. Click Variables.
    3. Add a new variable > e.g. vReportExecDuration.
    4. Add the expression...

    =IIf(System.DateTime.Now.Subtract(Globals!ExecutionTime).TotalSeconds < 1, "0 seconds", ( IIf(System.DateTime.Now.Subtract(Globals!ExecutionTime).Hours > 0, System.DateTime.Now.Subtract(Globals!ExecutionTime).Hours & " hour(s), ", "") + IIf(System.DateTime.Now.Subtract(Globals!ExecutionTime).Minutes > 0, System.DateTime.Now.Subtract(Globals!ExecutionTime).Minutes & " minute(s), ", "") + IIf(System.DateTime.Now.Subtract(Globals!ExecutionTime).Seconds > 0, System.DateTime.Now.Subtract(Globals!ExecutionTime).Seconds & " second(s)", "")) )

    1. Ok to save the state.
    2. From your text box in the header/footer, add =Variables!vReportExecDuration.Value and that will be static on every report page.

提交回复
热议问题