poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karanth, Ranganath Krishnayya (Ranganath)" <karan...@lucent.com>
Subject StringIndexOutOfBoundsException when setting the formula in the f ormulacell.
Date Thu, 30 Sep 2004 13:37:00 GMT
I have an Excel file containing 2 sheets named Sheet1 and Sheet2. 
In Sheet 1 I have a column called Equipment Name.
In Sheet2 I have a formula cell which will Check for the Named ranges called
'xxx' and gets the Equipment name from Sheet1.

The cell formula is as followes.
=IF(ISNA(LOOKUP(B5,xxx,Sheet1!C5:C10)),"",LOOKUP(B5,xxx,Sheet1!C5:C10))

When I create an Excel file using POI (poi-2.0-RC2-20040102), during setting
the formula for the cell, I am getting the following Error. The same formula
If I use directly in Excel sheet it works fine.

Can somebody help me out in this.

java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.String.charAt(String.java:444)
	at
org.apache.poi.hssf.util.CellReference.<init>(CellReference.java:81)
	at
org.apache.poi.hssf.record.formula.ReferencePtg.<init>(ReferencePtg.java:94)
	at
org.apache.poi.hssf.model.FormulaParser.Ident(FormulaParser.java:329)
	at
org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:512)
	at
org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:586)
	at
org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:634)
	at
org.apache.poi.hssf.model.FormulaParser.Arguments(FormulaParser.java:491)
	at
org.apache.poi.hssf.model.FormulaParser.function(FormulaParser.java:353)
	at
org.apache.poi.hssf.model.FormulaParser.Ident(FormulaParser.java:303)
	at
org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:512)
	at
org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:586)
	at
org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:634)
	at
org.apache.poi.hssf.model.FormulaParser.Arguments(FormulaParser.java:481)
	at
org.apache.poi.hssf.model.FormulaParser.function(FormulaParser.java:353)
	at
org.apache.poi.hssf.model.FormulaParser.Ident(FormulaParser.java:303)
	at
org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:512)
	at
org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:586)
	at
org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:634)
	at
org.apache.poi.hssf.model.FormulaParser.Arguments(FormulaParser.java:481)
	at
org.apache.poi.hssf.model.FormulaParser.function(FormulaParser.java:353)
	at
org.apache.poi.hssf.model.FormulaParser.Ident(FormulaParser.java:303)
	at
org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:512)
	at
org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:586)
	at
org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:634)
	at
org.apache.poi.hssf.model.FormulaParser.parse(FormulaParser.java:738)
	at
org.apache.poi.hssf.usermodel.HSSFCell.setCellFormula(HSSFCell.java:715)
	at WriteExcelUtil.changeCellFormula(WriteExcelUtil.java:252)
	at WriteExcelUtil.mapResponseSheet(WriteExcelUtil.java:183)
	at WriteExcelUtil.<init>(WriteExcelUtil.java:51)
	at WriteExcelUtil.main(WriteExcelUtil.java:64)

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Mime
View raw message