Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Created Unassigned: Numberformat.Format and date issue [15174]

$
0
0
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.




Viewing all articles
Browse latest Browse all 2262

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>