[英]How to check a column is hidden or not in excel file using apache poi
您可以使用将列设置为隐藏/取消隐藏
sheet.setColumnHidden(int columnIndex, boolean hidden);
例如
sheet.setColumnHidden(2, true); // this will hide the column index 2
sheet.setColumnHidden(2, false); // this will unhide the column index 2
并且可以使用隐藏或不隐藏列
sheet.isColumnHidden(int columnIndex);
例如
sheet.isColumnHidden(2); //this will check the 2nd column index whether it is hidden or not
Sheet
类具有方法boolean isColumnHidden(int columnIndex)
以及方法int getColumnWidth(int columnIndex)
,但返回的宽度是字符宽度的单位。 不确定这对你有帮助吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.