MiniExcel
MiniExcel copied to clipboard
Excel not recognize Date when use SaveAsByTemplate
When save a Date with SaveAs excel recognize the Date, when do the same but with SaveAsByTemplate the Date is not recognized.
dati.Dati.Add(new
{
Data = DateTime.Now
}); ;
// Don't recognize Data as date
MiniExcel.SaveAsByTemplate(outFile, Properties.Settings.Default.Template, dati,);
// Recognize Data as date
MiniExcel.SaveAs(outFile, dati.Dati.AsEnumerable());
Still an issue,
Dates should be converted to DECIMAL and set as a number on the cell, so the excels' cell formatting takes over the way how we display the date (mm/dd/yyyy or any other alt.).