Return-Path: Delivered-To: apmail-jakarta-poi-dev-archive@apache.org Received: (qmail 39729 invoked from network); 12 Aug 2003 14:08:57 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 12 Aug 2003 14:08:57 -0000 Received: (qmail 12052 invoked by uid 97); 12 Aug 2003 14:11:38 -0000 Delivered-To: qmlist-jakarta-archive-poi-dev@nagoya.betaversion.org Received: (qmail 12045 invoked from network); 12 Aug 2003 14:11:38 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 12 Aug 2003 14:11:38 -0000 Received: (qmail 39553 invoked by uid 500); 12 Aug 2003 14:08:54 -0000 Mailing-List: contact poi-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "POI Developers List" Reply-To: "POI Developers List" Delivered-To: mailing list poi-dev@jakarta.apache.org Received: (qmail 39537 invoked from network); 12 Aug 2003 14:08:53 -0000 Received: from unknown (HELO geriatrix.itellix.net) (203.145.183.216) by daedalus.apache.org with SMTP; 12 Aug 2003 14:08:53 -0000 Received: from cacofonix.in.itellix.net (cacofonix.in.itellix.net [10.0.2.13]) by geriatrix.itellix.net (Postfix) with ESMTP id C614E430F88 for ; Tue, 12 Aug 2003 19:33:20 +0530 (IST) Received: from it-avik.in.itellix.net (it-avik.in.itellix.net [10.0.2.122]) by cacofonix.in.itellix.net (Postfix) with ESMTP id E4EEBCC004 for ; Tue, 12 Aug 2003 19:40:50 +0530 (IST) Subject: Re: ATTR(semiVolatile) From: Avik Sengupta To: poi-dev@jakarta.apache.org In-Reply-To: <3F38F339.30003@appresso.com> References: <3F38F339.30003@appresso.com> Content-Type: text/plain Organization: Message-Id: <1060696973.4894.11.camel@IT-avik.in.itellix.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 12 Aug 2003 19:32:53 +0530 Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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.(CellReference.java:81) > at > org.apache.poi.hssf.record.formula.ReferencePtg.(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 --------------------------------------------------------------------- To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: poi-dev-help@jakarta.apache.org