// Displays the field as Text. ExcelBuf.AddColumn('$' + FORMAT(PurchLine."Direct Unit Cost"),FALSE,'',FALSE,FALSE,FALSE,'',ExcelBuf."Cell Type"::Text); // and/or // Displays the field as number but without the currency format ($) ExcelBuf.AddColumn(PurchLine."Direct Unit Cost",FALSE,'',FALSE,FALSE,FALSE,'',ExcelBuf."Cell Type"::Number);
Comments
e.g.
ExcelBuf.AddColumn(PurchLine."Direct Unit Cost",FALSE,'',FALSE,FALSE,FALSE,'','$####.00');
Unfortunately, I used the suggested solution but it didn't work for me, So I used something we used to have in .net Development, right click on "AddColumn" method and choose "Go to Definition", in the definition I found that 7th parameter is 'NumFormat', so i got the number format string form Excel and passed it as text format parameter of the method and it worked! =D>
this is the code I used: