POI 导入Excel 提示LeftoverDataException求帮助
我的哪个可能是因为excel的问题,每次打开提示用宏,低版本怕是不支持(之前用的是3.1),后来换成3.8版本就没问题了
你试试看 是不是版本的问题
[解决办法]
不是版本的问题,在网上找到了答案
重写了POI 中的RecordInputSream.java , 3.7,3.8 重写后都OK
重写的方法为
public boolean hasNextRecord() throws LeftoverDataException {
if (_currentDataLength != -1 && _currentDataLength != _currentDataOffset) {
readToEndOfRecord();
}
if (_currentDataLength != DATA_LEN_NEEDS_TO_BE_READ) {
_nextSid = readNextSid();
}
return _nextSid != INVALID_SID_VALUE;
}
private void readToEndOfRecord(){
while(this._currentDataOffset<this._currentDataLength)
readByte();
}
}