You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Brian Andersen <ba...@softhome.net> on 2004/07/15 17:22:06 UTC
Simple Formula Problem
I have created a very simple formula that doesn't seam to work in HSSF.
The formula is as follows:
cell.setCellFormula(222222-111111)
When I do this I get an Exception as follows:
java.lang.NumberFormatException: Value out of range. Value:"222222" Radix:10
The strange thing is that I can use smaller numbers with no problems.
For example cell.setCellFormula(22-11) works just fine. Does anyone
have any ideas on this?
Thanks,
Brian Andersen
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org
Re: AW: Simple Formula Problem
Posted by Brian Andersen <ba...@softhome.net>.
Here it is.
java.lang.NumberFormatException: Value out of range. Value:"222222" Radix:10
at java.lang.Short.parseShort(Unknown Source)
at java.lang.Short.parseShort(Unknown Source)
at org.apache.poi.hssf.record.formula.IntPtg.<init>(IntPtg.java:95)
at
org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:524)
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
info.compusoftinc.workbench.ExportToSpreadsheet.createNewCell(ExportToSpreadsheet.java:202)
at
info.compusoftinc.designer.ExportReportToSpreadsheet.<init>(ExportReportToSpreadsheet.java:173)
at
info.compusoftinc.designer.viewer.ReportViewerJFrame.exportToSpreadsheet(ReportViewerJFrame.java:528)
at
info.compusoftinc.designer.viewer.ReportViewerJFrame.connEtoC12(ReportViewerJFrame.java:279)
at
info.compusoftinc.designer.viewer.ReportViewerJFrame.access$21(ReportViewerJFrame.java:275)
at
info.compusoftinc.designer.viewer.ReportViewerJFrame$IvjEventHandler.actionPerformed(ReportViewerJFrame.java:100)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown
Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at
info.compusoftinc.workbench.WaitCursorEventQueue.dispatchEvent(WaitCursorEventQueue.java:69)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Avik Sengupta wrote:
>seems like a bug.. can u provide the stacktrace?
>
>
>On Fri, 2004-07-16 at 00:38, Brian Andersen wrote:
>
>
>>Thank you for the reply. Actually it is a String (I just didn't type it
>>correctly in the email). It is really is follows:
>>
>>String formula = "222222-111111";
>>
>>cell.setCellFormula(formula);
>>
>>
>>KHZ (SAW) wrote:
>>
>>
>>
>>>Hi Brian.
>>>
>>>Why don't you use a string?
>>>
>>>Regards, Karl-Heinz.
>>>
>>>
>>>-----Ursprüngliche Nachricht-----
>>>Von: Brian Andersen [mailto:bandersen55@softhome.net]
>>>Gesendet: Donnerstag, 15. Juli 2004 17:22
>>>An: POI Users List
>>>Betreff: Simple Formula Problem
>>>
>>>I have created a very simple formula that doesn't seam to work in HSSF.
>>>
>>>The formula is as follows:
>>>
>>>cell.setCellFormula(222222-111111)
>>>
>>>When I do this I get an Exception as follows:
>>>
>>>java.lang.NumberFormatException: Value out of range. Value:"222222"
>>>Radix:10
>>>
>>>The strange thing is that I can use smaller numbers with no problems.
>>>For example cell.setCellFormula(22-11) works just fine. Does anyone
>>>have any ideas on this?
>>>
>>>Thanks,
>>>
>>>Brian Andersen
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: poi-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: poi-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: poi-user-help@jakarta.apache.org
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org
Re: AW: Simple Formula Problem
Posted by Avik Sengupta <av...@itellix.com>.
seems like a bug.. can u provide the stacktrace?
On Fri, 2004-07-16 at 00:38, Brian Andersen wrote:
> Thank you for the reply. Actually it is a String (I just didn't type it
> correctly in the email). It is really is follows:
>
> String formula = "222222-111111";
>
> cell.setCellFormula(formula);
>
>
> KHZ (SAW) wrote:
>
> >Hi Brian.
> >
> >Why don't you use a string?
> >
> >Regards, Karl-Heinz.
> >
> >
> >-----Ursprüngliche Nachricht-----
> >Von: Brian Andersen [mailto:bandersen55@softhome.net]
> >Gesendet: Donnerstag, 15. Juli 2004 17:22
> >An: POI Users List
> >Betreff: Simple Formula Problem
> >
> >I have created a very simple formula that doesn't seam to work in HSSF.
> >
> >The formula is as follows:
> >
> >cell.setCellFormula(222222-111111)
> >
> >When I do this I get an Exception as follows:
> >
> >java.lang.NumberFormatException: Value out of range. Value:"222222"
> >Radix:10
> >
> >The strange thing is that I can use smaller numbers with no problems.
> >For example cell.setCellFormula(22-11) works just fine. Does anyone
> >have any ideas on this?
> >
> >Thanks,
> >
> >Brian Andersen
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: poi-user-help@jakarta.apache.org
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: poi-user-help@jakarta.apache.org
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org
Re: AW: Simple Formula Problem
Posted by Brian Andersen <ba...@softhome.net>.
Thank you for the reply. Actually it is a String (I just didn't type it
correctly in the email). It is really is follows:
String formula = "222222-111111";
cell.setCellFormula(formula);
KHZ (SAW) wrote:
>Hi Brian.
>
>Why don't you use a string?
>
>Regards, Karl-Heinz.
>
>
>-----Ursprüngliche Nachricht-----
>Von: Brian Andersen [mailto:bandersen55@softhome.net]
>Gesendet: Donnerstag, 15. Juli 2004 17:22
>An: POI Users List
>Betreff: Simple Formula Problem
>
>I have created a very simple formula that doesn't seam to work in HSSF.
>
>The formula is as follows:
>
>cell.setCellFormula(222222-111111)
>
>When I do this I get an Exception as follows:
>
>java.lang.NumberFormatException: Value out of range. Value:"222222"
>Radix:10
>
>The strange thing is that I can use smaller numbers with no problems.
>For example cell.setCellFormula(22-11) works just fine. Does anyone
>have any ideas on this?
>
>Thanks,
>
>Brian Andersen
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org
AW: Simple Formula Problem
Posted by "KHZ (SAW)" <ka...@sawag.com>.
Hi Brian.
Why don't you use a string?
Regards, Karl-Heinz.
-----Ursprüngliche Nachricht-----
Von: Brian Andersen [mailto:bandersen55@softhome.net]
Gesendet: Donnerstag, 15. Juli 2004 17:22
An: POI Users List
Betreff: Simple Formula Problem
I have created a very simple formula that doesn't seam to work in HSSF.
The formula is as follows:
cell.setCellFormula(222222-111111)
When I do this I get an Exception as follows:
java.lang.NumberFormatException: Value out of range. Value:"222222"
Radix:10
The strange thing is that I can use smaller numbers with no problems.
For example cell.setCellFormula(22-11) works just fine. Does anyone
have any ideas on this?
Thanks,
Brian Andersen
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org