How do you read a cell value if the user has restricted values that can be entered in the cell?
I am currently writing a program that reads coordinates to specify data cell locations for excel using xml. I iterate through the xml extracting data from cells, until i reach a restricted value cell, please could someone help to get round this, would be much appreciated.
thanks.........hitesh example code...........
//iterate through list for element(s) from xml file
for (int i = 0; i < list.getLength(); i++)
{
if (list.item(i).getNodeType() == Node.ELEMENT_NODE)
{
TagName = list.item(i).getNodeName();
System.out.println("TagName : " + TagName + " ");
//for each element get attribute values
Element el = (Element)list.item(i);
//get attribute values for element to get data cell values from excel sheet
tableValue = el.getAttribute("table");
rowValue = el.getAttribute("row");
int intRowValue = Integer.parseInt(rowValue);
row = sheet.getRow(intRowValue);
//System.out.println("row value " + intRowValue);
cellValue = el.getAttribute("cell");
intCellValue = Integer.parseInt(cellValue);
cell = row.getCell((short)intCellValue);
//System.out.println("cell value " + intCellValue);
//nedd to check for cell dat type
if(cell.getCellType() == HSSFCell.CELL_TYPE_STRING)
{
dataValue = cell.getStringCellValue();
System.out.println(" This is string" + dataValue);
}
if(cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC)
{
Double tempDouble = new Double(cell.getNumericCellValue());
dataValue = tempDouble.toString();
System.out.print(" This is numeric " + dataValue);
}
//store values into row object
Row r = new Row(TagName, dataValue, tableValue);
dataMap.put(TagName + i, r);
}
}
_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
