Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

need to pass currency symbol with amount in excel export in ax 2012 r3

Posted on by 5,885

Hi All,

Can you please let me know, how i have to display amount with currency symbol in EXCEL.

5633.a8.jpg

my code

excelWorksheet.cells().item(k,18).value(salesUnitPrice);

is this possible here to pass currency symbol?

please give me more shd on this.

thanks!

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: need to pass currency symbol with amount in excel export in ax 2012 r3

    You can pass any values you want. But if you want to put currency symbol and amount in the same field, then you must combine these two into one string in x++, and then pass this string in your Excel cell.

  • Suggested answer
    Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,083 on at
    RE: need to pass currency symbol with amount in excel export in ax 2012 r3

    Hi @pr@n,

    You need to use NumberFormat method on SysExcelRange class to apply the format you need. And to get range from row and column value you can use SysExcelWorksheetHelper.getWorksheetRange.

    To get an understanding of what should you do in x to achieve something in Excel, you can open empty Excel, start Macro recording and do needed changes on the sheet in Excel (like change format). When you stop macro recording you will get code you want to apply in x (of course it VB, but it can be easily converted to X ).

    Number format in your case could be

    "[$¥-ja-JP]#,##0.00"

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 287,914 Super User on at
    RE: need to pass currency symbol with amount in excel export in ax 2012 r3

    Hi @rp@n,

    Displaying the currency symbol in the same cell as the amount is related to the cell format; not the value. It should be possible to manage the format using the Excel API. You can try to find some information how to change cell format using the Excel API, you can record a macro in Excel and see what methods are being called or ask your question on the Excel community: techcommunity.microsoft.com/.../Excel_Cat

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,914 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,549 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans