poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sumit_Mac...@external.mckinsey.com
Subject Re: problem evaluating reference to another sheet
Date Fri, 07 Jul 2006 20:21:04 GMT
Jeff,
        Cell references to other worksheets within the worksheet should 
work. When I implemented this, I found that "spaces" within the sheet name 
are not recognized by POI. If sheet names are like "firstname lastname" 
then it will create problems. Try removing the space chars in the names 
and then give it a shot. 
I did this while "creating" multi-tab excel workbook having cross 
reference formula's.
hope this helps. 

Sumit 




"Jeff Kays" <Jeff.Kays@onvoy.com> 
07/07/2006 03:38 PM
Please respond to
"POI Users List" <poi-user@jakarta.apache.org>


To
<poi-user@jakarta.apache.org>
cc

Subject
problem evaluating reference to another sheet






Hi. I'm trying to read an Excel spreadsheet that has references to other 
sheets in the same workbook. References to cells on my current sheet work 
fine, but when I try to evaluate one of these references to another sheet 
I get the following exception:
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:44)
        at 
org.apache.poi.hssf.record.formula.ReferencePtg.<init>(ReferencePtg.java:50)
        at 
org.apache.poi.hssf.model.FormulaParser.Ident(FormulaParser.java:292)
        at 
org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:480)
        at 
org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:569)
        at 
org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:617)
        at 
org.apache.poi.hssf.model.FormulaParser.parse(FormulaParser.java:721)
        at 
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.internalEvaluate(HSSFFormulaEvaluator.java:284)
        at 
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluate(HSSFFormulaEvaluator.java:181)


I'm using the 3.0 alpha1 jars.
My questions are: Should this work? If not, can I do something like create 
an HSSFFormulaEvaluator for the sheet being referenced and then evaluate 
the cell on the reference sheet with that evaluator?

Any help is greatly appreciated!

  jeff


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/





+=========================================================+
This message may contain confidential and/or privileged
information.  If you are not the addressee or authorized to
receive this for the addressee, you must not use, copy,
disclose or take any action based on this message or any
information herein.  If you have received this message in
error, please advise the sender immediately by reply e-mail
and delete this message.  Thank you for your cooperation.
+=========================================================+

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message