MiniExcel icon indicating copy to clipboard operation
MiniExcel copied to clipboard

Excel not recognize Date when use SaveAsByTemplate

Open mfrigerio-rgl opened this issue 8 months ago • 1 comments

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());

mfrigerio-rgl avatar Jun 27 '25 08:06 mfrigerio-rgl

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.).

hidegh avatar Aug 20 '25 13:08 hidegh