Friday, September 2, 2011

How to pass real value to excel through the Code

Hi...

I just came across that while generating a report data into excel through code, required to pass the real values in the report.
Here is an example which illustrates how to pass the real value into excel by ussing the "Arrays"....

static void realValinArrays(Args _args)
{
    //Declaration of Array type -- real...
    Array             arr = new Array(Types::Real);
    CommaIO      commaIO;
    str                  fileName;
    container        con;
    int                  i;
    ;
   
    fileName    = WinAPI::getTempPath() + "Example" + ".csv";
    commaIO = new CommaIO(fileName,"w");
   
    arr.value(1,19.23); //Inserting the real value 19.23 in array postion 1
    arr.value(2,20.0);  //Inserting the real value 20.0 in array postion 2
   
    for( i = 1; i <= 2; i++)
    {
        con = [arr.value(i)];
        commaIO.write(con);
    }
   
    WinAPI::shellExecute(fileName);
}

Thursday, September 1, 2011

How to move Security Settings from one environment to other environment.

By using the Standard AX functionality of Export/Import function...
Let say that testing -- TestServer and production --- ProdServer.

Now log onto TestServer
1. Go to Administration ---> Setup ---> Security ---> User group permissions
2. Select the User group and Domain which you want to export as shown in the screen shot.

3. Click on the Export button and give the file name and location and Click OK
4. Once it is exported use the file to import into the ProdServer.

Now Log into ProdServer.
1. Go to Administration ---> Setup ---> Security ---> User group permissions
2. Select the User group and Domain for which you want to import the security settings and click the Import button as shown in below.

3. Attach the exported file and click OK, the setting gets imported into the ProdServer.