rabanti-github / PicoXLSX

PicoXLSX is a small .NET / C# library to create XLSX files (Microsoft Excel 2007 or newer) in an easy and native way
MIT License
52 stars 13 forks source link

custom cell style for dates #13

Closed amped77 closed 4 years ago

amped77 commented 4 years ago

Hi,

How do you define a cell style custom format for a date ? I wanted to make the cell style for a date as yyyy.mm.dd

Regards,

amped77 commented 4 years ago

never mind stupid of me hehehe finally made it to work

Style style = new Style(); style.CurrentNumberFormat.Number = NumberFormat.FormatNumber.custom; style.CurrentNumberFormat.CustomFormatID = 180; style.CurrentNumberFormat.CustomFormatCode = "yyyy.mm.dd"; WS.AddNextCell(mydate, style);

rabanti-github commented 4 years ago

Glad you could bring it to work. I consider to add more documentation or at least an additional demo to demonstrate this, since custom styling is quite complicated.