Run the SRSReportServerWarmup class
Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2
Microsoft SQL Server Reporting Services periodically restarts, and each restart clears the Reporting Services cache. After the cache has been cleared, it may take some time for the next report that is run to display. To minimize the effect of Reporting Services restarts, a new class that is named SRSReportServerWarmup is included with cumulative update 7 for Microsoft Dynamics AX 2012 R2. When the SRSReportServerWarmup class runs, it prepares the report server for use by performing the following tasks:
Loads Microsoft Dynamics AX business logic assemblies
Connects to Reporting Services
Runs a sample report that is named SRSReportServerWarmup
As a best practice, you should run the SRSReportServerWarmup class after Reporting Services restarts. The following procedures explain how to use the SRSReportServerWarmup class.
Deploy the SRSReportServerWarmup report
When the SRSReportServerWarmup class runs, it prepares the report server for use by running a sample report that is named SRSReportServerWarmup. You must deploy this report to the report server. For information about how to deploy a report, see Deploy the default reports.
Create a batch group
A batch job is used to run the SRSReportServerWarmup class. (You’ll create this batch job in the next procedure.) We recommend that this batch job run within the context of a batch group. Complete the following procedure to create a batch group.
Click System administration > Setup > Batch group.
Click New to create a new batch group.
In the Group field, enter a unique name for the batch group. For example, enter SSRS.
In the Description field, enter a description to help you identify the batch group.
Click the Batch servers tab.
The Selected servers list displays the AOS instances that the batch group runs on. The Remaining servers list displays the remaining AOS instances that are available as batch servers.
Use the arrow buttons to add servers to the Selected servers list or to remove servers from the Selected servers list.
Create a batch job
Complete the following procedure to create a batch job that will run the SRSReportServerWarmup class.
Open the Microsoft Dynamics AX Application Object Tree (AOT).
Expand the Classes node.
Right-click the SRSReportServerWarmup class, and then click Open. A form is displayed that lets you configure the batch job.
Select the Batch processing check box.
In the Task description field, enter a description for this batch job.
In the Batch group list, select the batch group that you created in the previous procedure.
Select the Private check box if you want to restrict other users from running this batch job. A private batch job can be run only by the user who created it and only on the computer where the user is logged on.
Click Recurrence to specify how often this batch job will run.
For example, if your report server restarts each night, you might want to schedule this batch job to run every morning. In this case, we recommend that you schedule the batch job to run before your employees start to work each day.
Click Alerts to send notifications when this batch job ends, has an error, or is canceled.
Extend the SRSReportServerWarmup class
When the SRSReportServerWarmup class runs, it prepares the report server for use by running a sample report that is named SRSReportServerWarmup. You can customize the SRSReportServerWarmup class so that it runs additional, specific reports.
For example, assume that Phyllis, the Accounts Payable manager in your organization, runs the Vendor Aging report every morning. To ensure that this report renders quickly for Phyllis, you can customize the SRSReportServerWarmup class so that it runs the Vendor Aging report every morning. To do this, you’ll need to create a new method that runs the Vendor Aging report and then configure the SRSReportServerWarmup class to call this new method.
Microsoft Dynamics AX provides sample code to help you create a new method. The following procedure explains how to use this sample code to create a method, and then configure the SRSReportServerWarmup class to call the new method.
Open the AOT.
Expand the Classes > SRSReportServerWarmup node.
Is the report that you’re going to run based on a report data provider (RDP) class?
Yes - If the report is based on an RDP class, right-click runSampleRdpReportWithParameters, and then click View Code. Copy the sample code that is displayed. You’ll use this code as a template for the new method that you create.
No - If the report is not based on an RDP class, right-click runSampleRdlReportWithParameters, and then click View Code. Copy the sample code that is displayed. You’ll use this code as a template for the new method that you create.
For more information about RDP classes, see How to: Use a Report Data Provider Class in a Report.
Create the new method. To do this, follow these steps:
Right-click the SRSReportServerWarmup class, and then click New > Method.
Select the code that is displayed, right-click, and then click Paste. The sample code that you copied in step 3 is displayed.
Customize the code. For example, specify the report design to use. Additionally, if the report requires parameters, enter values for the parameters.
Save the new method.
Configure the SRSReportServerWarmup class to call the new method. To do this, follow these steps:
Right-click the run method, and then click View Code.
Add code to call the new method that you created in step 4.
Save the run method.
Right-click the SRSReportServerWarmup class, and then click Compile.
The method should compile without errors or warnings.
Click Build > Generate Incremental CIL.
When the process is completed, you receive a message that states that the incremental CIL was generated.