Sunday, November 18, 2012

SSRS Report AX 2012 - The operation has timed out error message when you run a report in Microsoft Dynamics AX

Hi


About this problem, read below and test to find if this will have improved SSRS Report performance:

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 these pre-processing way ( Similar Sales confirmation, Sales Invoice, etc. reports ), see this example below for the Dimension Statement 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 “LedgerDimensionTransStatement”.

3.    Find this menu item in AOT > Menu Items > Output

…and look at the properties, make a note of the “LinkedPermissionObject”, in this case “LedgerTransStatement”

4.    Next in the AOT > SSRS Reports > Reports, locate LedgerTransStatement, then expand this out until you see the Server Methods. Make a note of the Server Method class, in this case “LedgerTransStatementDP”

5.    In the AOT > Classes, locate and open class LedgerTransStatementDP.

6.    In the LedgerTransStatementDP\classDeclaration, change line 9 to extend SrsReportDataProviderPreProcess instead of SrsReportDataProviderBase

7.    Make a note of the Temp table used in the report, as above this is LedgerTransStatementTmp.

8.    Next, change the method LedgerTransStatementDP\processReport to add the following line after the contract (line 27):

 

ledgerTransStatementTmp.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 LedgerTransStatementTmp. Change the table properties as follows:

 

·         TableType = Regular

·         CreatedBy = Yes

·         CreatedTransactionId = Yes

 

10. Opened LedgerTransStatement.Detail report in Visual Studio and refreshed the data source to include new field (CreatedTransactionId).

11. Deployed the new LedgerTransStatement.Detail report.

12. In AX, did a Generate Incremental CIL.

13. Restart SSRS


Also, at this link

Microsoft Dynamics AX 2012 Reporting: How to run reports that executes longer than 10 minutes

The operation has timed out" error message when you run a report in Microsoft Dynamics AX 2012

AX 2012: Report timeout error

How To: Addressing SSRS Session Timeouts

you can find useful information about modify the SQL Reporting Send Timeout Parameter.

Denis



 

7 comments:

Unknown said...

Nice post Denis :)

Anonymous said...

This is a wonderful post. I applied this metholdology to a report we were having timeout issues with. One question though, since TempDB can no longer be used what will clean the temporary data up? I see a cleanUp method that based on the info online appears as if it should clear the data in the temp table but for me it does not. Is there something I am missing?

Siva said...

Hi Dennis, I have followed the procedure for AssetPeriodBalanceDP (fixed asset movement. But Report does not shows anything where as the Table contains data

Denis Macchinetti said...

Hi Richard

You have to use the class RecordSortedList and during insert you must specify the UserConnection.

See class SalesConfirmDP method ProcessReport.

Below a standard code :

recordList.insertDatabase(this.parmUserConnection()); //it is inserted within user user connection so the framework will delete it automatically after the report is done.

Regards
Denis

Denis Macchinetti said...

Hi Siva

You have refresh the Datasource of the Report and deploy it again ?

Denis

Anonymous said...

Hi Denis,

Have a similar. Problem like siva. Tried deploying / publishing the report again but still the report returns empty. Am I missing something additional .???

Lara

noo said...

hi denis,

Thanks a million! Your post saved my day :)

Have a nice day.

Seval