예제 #1
0
        public int GetColumnStyle(string dataFormat)
        {
            var numberFormat = new NumberFormat
            {
                FormatCode = dataFormat,
                Id = 164 + NumberFormats.Count // custom number formats start from numFmtId=164
            };

            var cellFormat = new CellFormat
            {
                FormatId = numberFormat.Id,
                Id = CellFormats.Count
            };

            NumberFormats.Add(numberFormat);
            CellFormats.Add(cellFormat);

            return cellFormat.Id;
        }