Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

New Post: SetColumnWidth hides column in Excel

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

Viewing all articles
Browse latest Browse all 1621

Trending Articles



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