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

Commented Issue: SetColumnHidden false does not work [4932]

$
0
0
I have a excel template with the hidden column C (s. attached file).
 
When I now try to unhide this column, npoi tells me, that the column is not hidden anymore. But when I open the written workbook
the column is still hidden.
 
Code to reproduce the issue:
FileStream templateFileStream = new FileStream("Test.xls", FileMode.Open);
HSSFWorkbook workbook = new HSSFWorkbook(templateFileStream);
bool hidden = workbook .GetSheetAt(0).IsColumnHidden(2); // returns true
workbook .GetSheetAt(0).SetColumnHidden(2, false);
hidden = workbook .GetSheetAt(0).IsColumnHidden(2); // returns false
FileStream outputFileStream = new FileStream("TestOut.xls", FileMode.Create)
workbook.Write(outputFileStream); // column is still hidden in written file
outputFileStream.Close();
Comments: ** Comment from web user: xyz37 **

Just false to true;

workbook .GetSheetAt(0).SetColumnHidden(2, true);

second parameter name hidden, that set hide to true.


Viewing all articles
Browse latest Browse all 1621

Trending Articles



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