Applying a date format to a column results in all subsequent columns also being set to date format.
I am using a simple template (file attached) and the following code to format the date column.
```
public static string RunSampleFormat(DirectoryInfo outputDir)
{
FileInfo newFile = new FileInfo(outputDir.FullName + @"\sampleFormat.xlsx");
if (newFile.Exists)
{
newFile.Delete(); // ensures we create a new workbook
newFile = new FileInfo(outputDir.FullName + @"\sampleFormat.xlsx");
}
FileInfo templateFile = new FileInfo(outputDir.FullName + @"\MyTemplate.xlsx");
using (ExcelPackage package = new ExcelPackage(newFile, templateFile ))
{
package.Workbook.Worksheets[1].Column(2).Style.Numberformat.Format = "dd/mm/yyyy";
package.Save();
}
return newFile.FullName;
}
```
This results in the decimal column 3 having the date format applied.
I am using a simple template (file attached) and the following code to format the date column.
```
public static string RunSampleFormat(DirectoryInfo outputDir)
{
FileInfo newFile = new FileInfo(outputDir.FullName + @"\sampleFormat.xlsx");
if (newFile.Exists)
{
newFile.Delete(); // ensures we create a new workbook
newFile = new FileInfo(outputDir.FullName + @"\sampleFormat.xlsx");
}
FileInfo templateFile = new FileInfo(outputDir.FullName + @"\MyTemplate.xlsx");
using (ExcelPackage package = new ExcelPackage(newFile, templateFile ))
{
package.Workbook.Worksheets[1].Column(2).Style.Numberformat.Format = "dd/mm/yyyy";
package.Save();
}
return newFile.FullName;
}
```
This results in the decimal column 3 having the date format applied.