Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Leading zero in export to excel

Posted on by 2,382

I am not getting leading zero while exporting data to excel using export to excel code . I have tried adding '''' with data but a character ' comes at the beginning.

 

*This post is locked for comments

  • TharangaC Profile Picture
    TharangaC 23,116 on at
    RE: Leading zero in export to excel

    Were we able to help you to resolve the issue?

  • Suggested answer
    TharangaC Profile Picture
    TharangaC 23,116 on at
    RE: Leading zero in export to excel

    You need to add four single quotes ('''') for the field which you want excel to format as text not as integer.

    Check below blog from Saurav : http://saurav-nav.blogspot.co.nz/2012/06/nav-report-export-to-excel-number-as.html

  • Andrea Antoniazzi Profile Picture
    Andrea Antoniazzi 285 on at
    RE: Leading zero in export to excel

    Hi NavTech,

    if you are using the Excel Buffer you can insert '@' in the NumberFormat field. For the decimal values you can insert '#,##0.00'

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Leading zero in export to excel

    Check the format function 

  • Suggested answer
    Alex A Profile Picture
    Alex A 2,348 on at
    RE: Leading zero in export to excel

    Hello, you need to highlight the columns in Excel and change the data type /number format. Set a Number format for numerical values, and set a Text format for all alphanumeric characters.

  • Suggested answer
    Binesh Profile Picture
    Binesh 7,885 on at
    RE: Leading zero in export to excel

    Hello,

    Put CellType as Text or @ while in export code.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Leading zero in export to excel

    hi,

    did you also used FORMAT(Number) i mean string to export := ''''+FORMAT(YourData)

    using the right syntax msdn.microsoft.com/.../dd301367(v=nav.80).aspx

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans