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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Zeros left in a column

Thread ID:





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

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 07:40 AM UTC

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 08:27 AM UTC

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 07:25 AM UTC

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon