Passing real value to excel

hi,

I have to pass a real value 19,00 to excel. But it is stored as 19.

What to do if i want to get 19,00 in excel?

if anyone has an idea please share it?

Thanks a lot,

ramya

Just set the cell format in Excel to Number, 2 decimal places.

hello martin,

thanks for your reply.

but users don’t want to do that, all times…they are expecting whenever excel generates it should be…

What we need to do through code in ax on sending values to excel?

please suggest a solution?

Regards,

Ramya

Hi Shanmugam,

What is the code written to generate the excel file…

This is example…it may help to sort the issue…

static void realValinArrays(Args _args)
{
Array arr = new Array(Types::Real);
CommaIO commaIO;
str fileName;
container con;
;

fileName = WinAPI::getTempPath() + “Example” + “.xls”;
commaIO = new CommaIO(fileName,“w”);

arr.value(1,19.23);

con = [arr.value(1)];
commaIO.write(con);

WinAPI::shellExecute(fileName);
}

It can be done from code too, of course. I don’t know how you create the file, for example in COM object model you can use Range.NumberFormat.

Sometimes the easiest solution is just to generate the file from a template.