Thursday, 10 March 2016

SSRS Report – Timeout error for Long running queries in AX2012

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 202.xx.xx.xx:80

Posted on August 6, 2013 by Siva Kumar
There is a process to change long running jobs so that they are run in a Pre-Processing way, so that all the data is prepared before the SSRS Report Window is started. This prevents the timeout problem, sometimes shown by the message
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
To change the report to run in this pre-processing way (Similar to Sales confirmation, Sales Invoice, etc. reports).
see this example below for the Fixed Asset movement report on how to change this:
1. To find which object you need to modify, first look in the AOT >> Menus, for the Menu where the report is
2. View the properties on this to see the associated menu item. You can see below the menu item is “AssetBalancesPeriod”.
3. Find this menu item in AOT >> Menu Items >> Output and look at the properties, make a note of the “LinkedPermissionObject”, in this case “AssetBalancesPeriod”
4. Next in the AOT >> SSRS Reports >> Reports, locate AssetBalancesPeriod, then expand this out until you see the Server Methods. Make a note of the Server Method class, in this case “AssetBalancesPeriodDP”
5. In the AOT >> Classes, locate and open class AssetBalancesPeriodDP.
6. In the AssetBalancesPeriodDP\classDeclaration, change the extend class to SrsReportDataProviderPreProcess instead of SrsReportDataProviderBase
7. Make a note of the Temp table used in the report, as above this is AssetBalancesPeriodTmp.
8. Next, change the method AssetBalancesPeriodDP\processReport to add the following line after the contract:
contract.parmFromDate();
contract.parmtodate();
AssetBalancesPeriodTmp.setConnection(this.parmUserConnection());
9. Next, in AOT > Data Dictionary > Tables, locate the table you made a note of in point 7, so in this case the AssetBalancesPeriodTmp. Change the table properties as follows:
• TableType = Regular
• CreatedBy = Yes
• CreatedTransactionId = Yes
10. Opened AssetBalancesPeriod report in Visual Studio and refreshed the data source to include new field (CreatedTransactionId).
11. Deployed the new AssetBalancesPeriod report.
12. In AX did a Generate Incremental CIL.
13. Restart SSRS
Now this report can run without timeout error.



Happy DAXing
................

No comments:

Post a Comment