You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Avik Sengupta <av...@apache.org> on 2003/08/12 16:02:53 UTC

Re: ATTR(semiVolatile)

not really clear what you are really trying to do, but if you want to
set the formula, you say cell.setCellFormula("TODAY()");

the ATTR(semiVolatile) bit is some Excel/poi innards coming out.. dont
bother too much about it... 

I suppose it would be best to ensure that ATTR does not print anything
out on a call to toFormulaString .. however, some code has been written
that assumes such a string return, so thats not an option in the short
term. 

hope that helps. If not, please tell us what code you are trying to
write. 

On Tue, 2003-08-12 at 19:31, Xuemin Guan wrote:
> Dear all, I am experiencing a problem with formula.
> Say, I have a cell set up a formula: TODAY().
> 
> The HSSFCell.getCellFormula() returns a String representing
> this formula as : TODAY(ATTR(semiVolatile)).
> 
> The ATTR(semiVolatile) is returned by the method
> toFormulaString(SheetReferences refs) of class
> AttrPtg (formula package).
> 
> When I set this as a formula to a new cell, I had the
> following exception:
> 
> Caused by: java.lang.StringIndexOutOfBoundsException: String index out 
> of range: 0
>      at java.lang.String.charAt(String.java:460)
>      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:311)
>      at 
> org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:484)
> ...
> 
> Then I tried to manually set it in a new cell with the MS-Excel 
> application. The Excel rejected it saying this is an invalid
> formula.
> 
> Any one knows, what I should do about this?
> 
> Thanks a lot,
> 
> Xuemin
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
-- 
Avik Sengupta <av...@apache.org>


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