public void createSerializedCell(short cellType, int sheetIndex,int
rowIndex,short colIndex,short styleIndex,String mDimDesc) throws
IOException{
Record cellRecord = null;
switch(cellType){
case NUMERIC_CELL:
cellRecord =
createNumericCellRecord(sheetIndex, rowIndex, colIndex,
styleIndex, Double.parseDouble(mDimDesc.toString()));
break;}
int recSize = cellRecord.getRecordSize();
byte recBytes[] = new byte[recSize];
cellRecord.serialize(0,recBytes);
if(sheetsStream!=null && sheetsStream[sheetIndex] != null){
sheetsStream[sheetIndex].write(recBytes,0,recBytes.length);
}
recBytes = null;
cellRecord = null;
}
public NumberRecord createNumericCellRecord(int sheetIndex,int
rowIndex,short colIndex,short styleIndex,double value){
CellValueRecordInterface cellRecord = new NumberRecord();
(( NumberRecord ) cellRecord).setColumn(colIndex);
(( NumberRecord ) cellRecord).setRow(rowIndex);
(( NumberRecord ) cellRecord).setValue(value);
(( NumberRecord ) cellRecord).setXFIndex(styleIndex);
return (NumberRecord)cellRecord;
}
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/Using-HSSF-record-methods-for-a-SS-usermodel-tp3246532p3248255.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]