Hi,
Well, there are two major data types that MS Excel does store data in numeric/numbers and strings values. For date type, MS Excel does store date in numeric values. If a pure number is inserted/filled into a cell, Ms Excel does convert it to numeric value automatically else it (alpha numeric or text) will be stored in string values.
1) For numeric conversion, you may try to use "numeric" parameter while defining markers in the template worksheet cells. e.g
&=Table1.Field1(
numeric)
This way, Aspose.Cells will try to convert text to number if possible.
2) For date columns, since the dates are stored in numeric values, so you need to format the date columns by yourself according to your desired Date format. For example, after processing the smart markers and when the data is filled with your date values, you may format the column/cells/ or range to your desired date formats, see the sample code below:
//...............
Aspose.Cells.Style style = null;
StyleFlag flag = null;
flag = new StyleFlag();
style = wb.Styles[wb.Styles.Add()];
style.Custom = "mm/dd/yyyy";
flag.NumberFormat = true;
//Apply the custom date formatting style to first column
ws.Cells.ApplyColumnStyle(0, style, flag);
//............
See further reference about formatting a complete row/column etc.:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/formatting-rows-columns.htmlFor complete reference about Smart markers, see the document:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/smart-markers.html
Amjad Sahi
Support Developer,
Aspose Sialkot Team
Contact Us