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. Image for the cookie policy date

String values treated as numbers and leading zeroes are stripped

We are exporting data to Excel using XlsIO library. The string values in data table may have leading zeroes. The problem is these values are treated as numbers in Excel and leading zeroes are stripped out. 
Setting worksheet.IsStringsPreserved property to true is not the solution - all the values in the sheet will be treated as strings which is not desired behaviour. 
Also the predefined formatting of the column is ignored - the format of the first column is text, but the values are displayed as numbers with 2 decimal places.
Please see the attached project.
Thanks for advice,


1 Reply

MK Manoj Kumar G M Syncfusion Team December 9, 2013 10:12 AM UTC

Hi Rory Kingan,

Thank you for using Syncfusion products

Please enable the preserveTypes arugment when Importing data table to worksheet.

Following code example illustrates how to import a data table to a sheet

mainsheet.ImportDataTable(dataTable, true, 1, 1,true);


Live Chat Icon For mobile
Up arrow icon