We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Zeros left in a column

Thread ID:





129394 Mar 15,2017 12:22 PM Mar 17,2017 03:25 AM ASP.NET Web Forms 3
Tags: XlsIO
Asked On March 15, 2017 12:22 PM

I am trying to put in a column text with leading zeroes "0041123", and applying NumberFormat = "@" to the column it is formated as Text, but no zeros appear. Only "41123".

What do I have to apply to NumberFormat for zeros to appear?


Abirami Varadharajan [Syncfusion]
Replied On March 16, 2017 03:40 AM

Hi Juan, 
Thank you for contacting Syncfuison support. 
Kindly try below code to preserve the number preceding with 0’s as text.  
Code Example: 
            sheet.Range["A1"].Text = "0041123"; 
            sheet.Range["A1"].NumberFormat = "@"; 
            sheet.Range["A1"].IgnoreErrorOptions = ExcelIgnoreError.NumberAsText; 
Please let us know if you have any concerns. 

Replied On March 16, 2017 04:27 AM

Thank you very much for the quick response.
I got it working by modifying the data import:

worksheet.ImportDataTable(Datos, True, 1, 1, True)

I did not know the "IgnoreErrorOptions" option.

Thank you.

Abirami Varadharajan [Syncfusion]
Replied On March 17, 2017 03:25 AM

Hi Juan, 
Thank you for updating us. 
We are glad that the issue is resolved at your end. Please let us know if you need any further assistance. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.