SetColumnWidth hides column in Excel

Jul 9, 2014 at 6:14 AM
Edited Jul 9, 2014 at 6:40 AM
I create simple test:
        [Test]
        public void WidthExportTest()
        {
            var workbook = new HSSFWorkbook();
            var sheet = workbook.CreateSheet("Test");
            sheet.SetColumnWidth(0, 54);
            var row = sheet.CreateRow(0);
            var cell = row.CreateCell(0);
            cell.SetCellValue( "TestString");
            using (var stream = new FileStream(@"c:\temp\export.xls", FileMode.Create, FileAccess.Write))
            {
                workbook.Write(stream);
            }
        }
When I open c:\temp\export.xls with the Microsoft Excel the first column is hidden (width is 0). How to set column width correctly?

Fixed. It was my mistake (I thought SetColumnWidth accept width in Excel units) :).
Marked as answer by mukminoff on 7/8/2014 at 10:35 PM