You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Andreas Reichel <an...@manticore-projects.com> on 2015/03/21 10:30:38 UTC
org.apache.poi.ss.formula.FormulaParser.parseNonRange(FormulaParser.java:543)
--> Need book to evaluate name 'B65537'
Dear All,
inserting a lot of new rows into a XSSF Sheet works well up to row
65536, but finally fails:
com.manticore.report.ExcelTools.shiftRows(ExcelTools.java:90):
String oldFormula = oldCell.getCellFormula();
Ptg[] ptgs= FormulaParser.parse(
oldFormula
, parsingWorkbook
, FormulaType.CELL
, workbook.getSheetIndex(worksheet));
java.lang.IllegalStateException: Need book to evaluate name 'B65537'
at
org.apache.poi.ss.formula.FormulaParser.parseNonRange(FormulaParser.java:543)
at
org.apache.poi.ss.formula.FormulaParser.parseRangeable(FormulaParser.java:416)
at
org.apache.poi.ss.formula.FormulaParser.parseRangeExpression(FormulaParser.java:237)
at
org.apache.poi.ss.formula.FormulaParser.parseSimpleFactor(FormulaParser.java:1126)
at
org.apache.poi.ss.formula.FormulaParser.percentFactor(FormulaParser.java:1086)
at
org.apache.poi.ss.formula.FormulaParser.powerFactor(FormulaParser.java:1073)
at
org.apache.poi.ss.formula.FormulaParser.Term(FormulaParser.java:1433)
at
org.apache.poi.ss.formula.FormulaParser.additiveExpression(FormulaParser.java:1533)
at
org.apache.poi.ss.formula.FormulaParser.concatExpression(FormulaParser.java:1517)
at
org.apache.poi.ss.formula.FormulaParser.comparisonExpression(FormulaParser.java:1474)
at
org.apache.poi.ss.formula.FormulaParser.unionExpression(FormulaParser.java:1454)
at
org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:1575)
at
org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:145)
at com.manticore.report.ExcelTools.shiftRows(ExcelTools.java:90)
The formula itself is just a simple row counter, like "=B2+1". How can I
work around that problem please?
Best regards!
Re:
org.apache.poi.ss.formula.FormulaParser.parseNonRange(FormulaParser.java:543)
--> Need book to evaluate name 'B65537'
Posted by Andreas Reichel <an...@manticore-projects.com>.
Dominik,
thank you a lot, I will have too look into that.
Indeed I could reproduce the problem with a simplified code example yet
so I'll have to dig into the problem step by step.
Cheers!
On Sun, 2015-03-22 at 11:59 +0100, Dominik Stadler wrote:
> BTW, the code fails at
>
> if (_book == null) {
> // Only test cases omit the book (expecting it not to be needed)
> throw new IllegalStateException("Need book to evaluate
> name '" + name + "'");
> }
>
> and member _book is initialized in the constructor with whatever you
> provide as second parameter in FormulaParser.parse(), so it seems you
> start passing in null here somehow...
>
> Dominik.
>
> On Sun, Mar 22, 2015 at 1:26 AM, Nick Burch <ap...@gagravarr.org> wrote:
> > On Sun, 22 Mar 2015, Andreas Reichel wrote:
> >>
> >> it is my own class/code and I have shown the line causing this bug which
> >> is pure POI:
> >>
> >> Ptg[] ptgs= FormulaParser.parse(
> >> oldFormula
> >> , parsingWorkbook
> >> , FormulaType.CELL
> >> , workbook.getSheetIndex(worksheet));
> >
> >
> > Can you write a small junit unit test that shows up this problem? And did
> > you try it with Apache POI 3.12 beta 1?
> >
> >
> > Nick
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> > For additional commands, e-mail: user-help@poi.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
Re: org.apache.poi.ss.formula.FormulaParser.parseNonRange(FormulaParser.java:543)
--> Need book to evaluate name 'B65537'
Posted by Dominik Stadler <do...@gmx.at>.
BTW, the code fails at
if (_book == null) {
// Only test cases omit the book (expecting it not to be needed)
throw new IllegalStateException("Need book to evaluate
name '" + name + "'");
}
and member _book is initialized in the constructor with whatever you
provide as second parameter in FormulaParser.parse(), so it seems you
start passing in null here somehow...
Dominik.
On Sun, Mar 22, 2015 at 1:26 AM, Nick Burch <ap...@gagravarr.org> wrote:
> On Sun, 22 Mar 2015, Andreas Reichel wrote:
>>
>> it is my own class/code and I have shown the line causing this bug which
>> is pure POI:
>>
>> Ptg[] ptgs= FormulaParser.parse(
>> oldFormula
>> , parsingWorkbook
>> , FormulaType.CELL
>> , workbook.getSheetIndex(worksheet));
>
>
> Can you write a small junit unit test that shows up this problem? And did
> you try it with Apache POI 3.12 beta 1?
>
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: org.apache.poi.ss.formula.FormulaParser.parseNonRange(FormulaParser.java:543)
--> Need book to evaluate name 'B65537'
Posted by Nick Burch <ap...@gagravarr.org>.
On Sun, 22 Mar 2015, Andreas Reichel wrote:
> it is my own class/code and I have shown the line causing this bug which
> is pure POI:
>
> Ptg[] ptgs= FormulaParser.parse(
> oldFormula
> , parsingWorkbook
> , FormulaType.CELL
> , workbook.getSheetIndex(worksheet));
Can you write a small junit unit test that shows up this problem? And did
you try it with Apache POI 3.12 beta 1?
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re:
org.apache.poi.ss.formula.FormulaParser.parseNonRange(FormulaParser.java:543)
--> Need book to evaluate name 'B65537'
Posted by Andreas Reichel <an...@manticore-projects.com>.
Nick and Team.
it is my own class/code and I have shown the line causing this bug which
is pure POI:
Ptg[] ptgs= FormulaParser.parse(
oldFormula
, parsingWorkbook
, FormulaType.CELL
, workbook.getSheetIndex(worksheet));
java.lang.IllegalStateException: Need book to evaluate name 'B65537'
at
org.apache.poi.ss.formula.FormulaParser.parseNonRange(FormulaParser.java:543)
at
org.apache.poi.ss.formula.FormulaParser.parseRangeable(FormulaParser.java:416)
at
org.apache.poi.ss.formula.FormulaParser.parseRangeExpression(FormulaParser.java:237)
at
org.apache.poi.ss.formula.FormulaParser.parseSimpleFactor(FormulaParser.java:1126)
at
org.apache.poi.ss.formula.FormulaParser.percentFactor(FormulaParser.java:1086)
at
org.apache.poi.ss.formula.FormulaParser.powerFactor(FormulaParser.java:1073)
at org.apache.poi.ss.formula.FormulaParser.Term(FormulaParser.java:1433)
at
org.apache.poi.ss.formula.FormulaParser.additiveExpression(FormulaParser.java:1533)
at
org.apache.poi.ss.formula.FormulaParser.concatExpression(FormulaParser.java:1517)
at
org.apache.poi.ss.formula.FormulaParser.comparisonExpression(FormulaParser.java:1474)
at
org.apache.poi.ss.formula.FormulaParser.unionExpression(FormulaParser.java:1454)
at
org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:1575)
at org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:145)
My question is: why does the FormulaParser understand "=B1+1" up to
"=B65536+1", but eventually fails on "=B65536+1"?
Best regards
Andreas
On Sat, 2015-03-21 at 17:43 +0000, Nick Burch wrote:
> On Sat, 21 Mar 2015, Andreas Reichel wrote:
> > inserting a lot of new rows into a XSSF Sheet works well up to row
> > 65536, but finally fails:
> >
> > com.manticore.report.ExcelTools.shiftRows(ExcelTools.java:90):
>
> That isn't an Apache POI class. You might need to report the problem to
> whoever maintains that code
>
> (As long as you're on a new enough version of Apache POI, the POI part
> should work, so my hunch is that the bug is in the non-POI code you're
> using)
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
Re: org.apache.poi.ss.formula.FormulaParser.parseNonRange(FormulaParser.java:543)
--> Need book to evaluate name 'B65537'
Posted by Nick Burch <ap...@gagravarr.org>.
On Sat, 21 Mar 2015, Andreas Reichel wrote:
> inserting a lot of new rows into a XSSF Sheet works well up to row
> 65536, but finally fails:
>
> com.manticore.report.ExcelTools.shiftRows(ExcelTools.java:90):
That isn't an Apache POI class. You might need to report the problem to
whoever maintains that code
(As long as you're on a new enough version of Apache POI, the POI part
should work, so my hunch is that the bug is in the non-POI code you're
using)
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org