worksheet.Columns[0].Text = "Syncfusion";
Please try the above code snipppet at your side and let us know if this helps you.
Please let me know if you require any further clarifications.
Thanks,
Sridhar.S
Hi Gordon,
Thank you so much for the update.
Please use the below code snippet to set the custom date number format for the columns in the worksheet.
Code Snippet[C#]:
workSheet.Columns[0].CellStyle.NumberFormat ="m/d/yyyy";
Please take a look at the video to change the custom number format strings for the given data.
Video Link:
http://www.syncfusion.com/downloads/Support/DirectTrac/103072/Custom Format-459493620.zip
Note:The custom format string can be selected from the FormatCells windows dialog in MS Excel.
Please take a look at the video and let us know if this helps you.
If you are using ImportDataTable method to import the data to an excel worksheet please use the below overload method to import the data with their data types.
Code Syntax[C#]:
ImportDataTable(DataTable dataTable, bool isFieldNameShown, int firstRow, int firstColumn, bool preserveTypes);
Please take a look at the video, try the code snippets at your side and let us know if this helps you.
Please let me know if you have any concerns.
Thanks,
Sridhar.S
Queries |
Details |
we have used Cell .NumberFormat = "@" , And if Value is Numberic it is shown at 1.00 , Please check Attached Image.
|
If number format to a cell is applied as "@" in XlsIO, the numeric values is shown as 1 as in the below screen shot, which is the document generated using XlsIO and opened in Open Office 4.1.1. If your requirement is to set number as text, we recommend this option.
Note: We don’t find any attachment from your update. |
If we use .NumberFormat = "General" , Then Value Numeric is shown 1 but right-aligned . we have set .CellStyle.HorizontalAlignment = Syncfusion.XlsIO.ExcelHAlign.HAlignLefteven then value is right aligned.
|
Number with General format is always right aligned. This is the behavior in MS Excel and Open office. XlsIO also behaves similarly.
If the HAlign is set to Left, then the values are left aligned when applied in XlsIO.
|
If cell.NumberFormat = "text" , Then Also numeric values shown as 1.00 |
The numeric value is shown as 1, not as 1.00. |
The above scenarios are applied in a sample and shared in the following link for further reference.
Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/XlsIO_Sample-1662801360.zip
If the output of the given sample is not as in the above screen shot, then check your Open Office version and get back to us with necessary details. The issue might raise in a specific Open Office version.
If the issue still persists, kindly modify the sample to reproduce the issue and send back to us to investigate further on this.