Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check a column is hidden or not in excel file using apache poi

I am trying to parse a xls file using apache poi. Is it possible to check whether a column is hidden or not. How can I get the width of a particular column.

Example: According to the post here it checks if the row is hidden or not.

Similarly I want to check the width of a column ( or check if the column is hidden or not)

like image 795
ranjan Avatar asked Jul 16 '13 12:07

ranjan


1 Answers

you can set a column as hidden/unhidden by using

 sheet.setColumnHidden(int columnIndex, boolean hidden); 

e.g.

 sheet.setColumnHidden(2, true);   // this will hide the column index 2
 sheet.setColumnHidden(2, false);   // this will unhide the column index 2

and the column is hidden or not can be checked using

  sheet.isColumnHidden(int columnIndex);

e.g.

  sheet.isColumnHidden(2);   //this will check the 2nd column index whether it is hidden or not
like image 55
Sankumarsingh Avatar answered Sep 24 '22 01:09

Sankumarsingh