Problem: SSRS Report -Long running in AX D365

Hi,

Problem:: SSRS Report -Long running in AX D365

Solution:

1. In RDP class Declaration extend SrsReportDataProviderPreProcess instead of SrsReportDataProviderBase

2. Temp Table's Table Type properties should be TempDB

3.Set report connection to temp data table.

The temp table connection string statement will be look like

Process Method of DP Class.

  TempTable.setConnection(this.parmUserConnection());

4.For better performance RecordInsertList is used in processReport method to write data into database in one call - RecordInsertList


       
https://www.tech.alirazazaidi.com/how-to-handle-long-running-reports-in-dynamics-ax-2012-r3/
                                                     
https://blogs.msdn.microsoft.com/axperf/2014/05/06/improving-ssrs-report-performance-using-new-r3-features-part-6/

https://community.dynamics.com/ax/b/ax2012codingaxclated/archive/2016/02/04/ax-ssrs-regular-processing-srsreportdataproviderbase-vs-preprocessing-srsreportdataproviderpreprocess-fixes-timeout-issues-on-reporting


RECORDINSERTLIST

RecordInsertList            insertRecords;
SalesTable                     salesTable;

insertRecords           = new RecordInsertList(tableNum(SalesTradeOverEstTmp)); // Define the Table to insert

while select salesTable
{
salesTradeOverEstTmp.salesId = salesTable.salesId;
salesTradeOverEstTmp.CustAccount salesTable.CustAccount;

insertRecords.add(salesTradeOverEstTmp);
}

insertRecords.insertDatabase();



 MyInvoiceTmp        tempRecord;

    
    // This code compiles, but it generates a runtime
    // exception with a misleading message saying
    // that tempDb can not be used together with
    // RecordInsertList
    RecordInsertList    invoicesToBeInserted = new RecordInsertList(tableNum(MyInvoiceTmp), // table id
                                                                    false, // skip insert
                                                                    false, // skip database log
                                                                    false, // skip events
                                                                    false, // skip aos validation
                                                                    false, // skip RLS validation
                                                                    tempRecord); // buffer where records will be inserted



Comments

Post a Comment