I\'m using EPPlus
to generate Excel
files, in DAL I\'m populating DataTable
, filling data into table, and passing table to Presentation La
To use build in excel formats, you need to pass correct string to
sheet.Cells[1, 1].Style.Numberformat.Format
property.
Now, somewhere later during execution, probably during serialization, EPPlus will try to match this format property with current dictionary of styles in workbook. It may depend on exact library version, but for example for EPPlust 4.1.0.0 short date key is "mm-dd-yy".
For 4.1.0.0 you can find all hard-coded codes and keys to build in formats in:
internal static void AddBuildIn(XmlNamespaceManager NameSpaceManager, ExcelStyleCollection NumberFormats)
- here all of those codes are actually included into workbook, all hard-codedWorkbook.Styles.NumberFormats
enumeration (as key use ExcelNumberFormatXml.Format
) Workbook.Styles.NumberFormats.
(non public memeber)_dic
for exact keys.