Tuesday, 30 May 2017

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

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.

http://sinedax.blogspot.in/2012/11/ssrs-report-ax-2012-operation-has-timed.html

Sunday, 7 May 2017

Inserting Space between the characters in a String in Ax


Hi,

Today I would like to share you x++ code to insert space between the characters in a string in AX.

Example 1:

static void insertSpaceBtwString(Args _args)

{

str s,s1;

int i,j;

s="KORCOMPTENZ";

j= strLen(s);

for(i=1;i<=j;i++)

{

   s1=s1+subStr(s,i,1);

  if(i!=strLen(s))

  s1=s1+ " ";

}

info(s1);

}

Output:
Example 2:
Inserting space after each four digit Number

static void InsertSpace(Args _args)

{

str s,s1;

int i,j;

s="1245678945612355";

j= strLen(s);

for(i=1;i<=j;i=i+4)

{

    s1=s1+subStr(s,i,4);

    if(i+4<=j)

    s1=s1+" ";

}

info(s1);

}

Output:

Happy Daxing....