web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Leading zeros getting truncated from a number field while after converting AX report to excel through code

(0) ShareShare
ReportReport
Posted on by 45

Hi,

I have an AX report which i generate through code and save it as a document in excel format. But when i open that document leading zeros in that document gets truncated. For example i have a column named item number, item number = 000034, but when i open the excel it shows only 34. Four leading zeroes are truncated. Is there a way to handle this through code so that when i open the excel zeros are not truncated. 

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Dev,

    Look at the link below on how to format data in the columns for each cell:

    daxjoyie.blogspot.fr/.../create-excel-file-using-x.html

  • Community Member Profile Picture
    on at

    This is a setting in Excel and not in AX. I think by default it always truncs leading zeros. You can export the number as string to have the zeros, but it would be text in Excel as well which might cause formulas to fail.

  • Mohammad Raziq Ali Profile Picture
    2,486 on at

    Hi dev,

    try to use those number is string format in excel. It will work.

    hope this below link helps you.

    www.extendoffice.com/.../792-excel-add-leading-zeros-to-number-text.html

    Thanks,

    Raziq

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans