col1 col2 col3 col4
row1
row2
row3
row4
row5 Row Labels sum1 sum2 sum3
row6 blah 100 78 88
row7 blah 200 5 8
row8 blah 300 400 500
我正在使用这个poi来查找“行标签”的行索引。使用要做到这一点的代码IM是:APACHE POI,如何查找单元格的行索引?
for(int i=0;i<r;i++){
Row temprow=ws.getRow(i);
for(int j=0;j<ws.getRow(0).getLastCellNum();j++){
Cell cell=temprow.getCell(j);
try{
if(cell.getStringCellValue().equals("Row Labels")){
temp=j;
break;
}
}catch(Exception e){
continue;
}
}
break;
}
有史以来温度的值始终为零何时到来,应该是未来的4, 不能似乎怎么找到我的错误。 帮助! 谢谢
如果你试图通过它在调试步骤会发生什么事,你看到像您期望的流量? – Gagravarr
好吧,当我去调试其亮点 和temp的值为零 – Anish6595
其实,刚刚意识到你的图表在第一列中有文本“行标签”,是吗?如果是这样,那就是Index 0的列,所以'temp = j = 0'是完全可以预料的! (从你的代码,如果你想要的行号,保存我不是j) – Gagravarr