--- Begin Message ---
Hello,
I also had this problem recently. I don't know why but getHidden() always
returns false indeed.
Try instead to call: row.getZeroHeight().
It worked for me.
---------------------------------------------------------
om
-----Original Message-----
From: Jonathan Pittard [mailto:[email protected]]
Sent: mardi 9 novembre 2010 22:08
To: [email protected]
Subject: Hidden Rows in Manually-Created Sheets
Hello everyone,
I'm very new to POI, and am trying to add in a feature to an application which
uses it for the loading/parsing of manually-created xls sheets. The portion
with which I'm working iterates through the rows in a sheet and adds them to an
ArrayList<RowData> for further processing. The loop works fine - I'm getting
the data from the rows. However, I am attempting to modify the program to skip
over hidden rows. It seems as if POI is not correctly setting the _hidden
property for my rows, nor for the cells within them. Using both 2.2-FINAL and
2.6, I have tried...
for (int i = firstRow + 1; i <= lastRow; i++){
HSSFRow row = sheet.getRow(i);
if(row.getRowStyle()!=null && !row.getRowStyle().getHidden()){
//WORK
}
}
and also...
for (int i = firstRow + 1; i <= lastRow; i++){
HSSFRow row = sheet.getRow(i);
if(row.getCell(1).getCellStyle()!=null &&
!row.getCell(1).getCellStyle().getHidden()){
//WORK
}
}
getHidden() seems to always return false, even if I hide all the rows in the
sheet. I presume the problem is me. Is there something which I should be
doing to initialize the style object, or am I misusing the method? I tried
looking into the source, and am still investigating how POI instantiates
sheets, but so far have come up dry. Any help would be greatly appreciated,
and any additional information which might be needed to diagnose the issue, I
would be happy to provide.
Jonathan Pittard
RadarFind, Inc
Morrisville, NC, USA
--- End Message ---
Pour connaƮtre nos solutions et services, visitez:
http://www.ic.lu
To learn about our services and solutions, please visit:
http://www.ic.lu
This E-mail is confidential. If you are not the addressee you may not copy,
forward, disclose or use any part of it.
If you have received this message in error, please delete it and notify the
sender immediately by return E-mail.
Internet communications cannot be guaranteed to be timely, secure, error or
virus-free.
The sender does not accept liability for any errors or omissions.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]