Bug 47294 - XSSFWorkbook - FormulaParseException thrown from setRepeatingRowsAndColumns() when sheet name has a quote - ' in it.
Summary: XSSFWorkbook - FormulaParseException thrown from setRepeatingRowsAndColumns()...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.5-dev
Hardware: All All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-01 12:39 UTC by Leif Nelson
Modified: 2009-06-10 11:45 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leif Nelson 2009-06-01 12:39:45 UTC
Overview:

Using poi-3.5-beta5.jar, naming a sheet with a single quote on it, and then calling setRepeatingRowsAndColumns causes an Unparsable formula error to be thrown.  If I use HSSFWorkbook instead, no errros are thrown.  But, I'm trying to create xlsx files, so I must use XSSFWorkbook.

Steps to Reproduce:

try {
	Workbook wb = new XSSFWorkbook();
	wb.createSheet("Testing's sheet");
	wb.setRepeatingRowsAndColumns(0, 0, 0, 0, 3);
} catch (Exception e) {
	e.printStackTrace();
}

Actual Results:

java.lang.IllegalArgumentException: Unparsable formula ''Testing's sheet'!$A:$A,'Testing's sheet'!$1:$4'
	at org.apache.poi.xssf.usermodel.XSSFName.setRefersToFormula(XSSFName.java:205)
	at org.apache.poi.xssf.usermodel.XSSFWorkbook.setRepeatingRowsAndColumns(XSSFWorkbook.java:941)
	at gov.llnl.ais.reporting.engine.adhoc.TestExcel.main(TestExcel.java:13)
Caused by: org.apache.poi.ss.formula.FormulaParser$FormulaParseException: Specified named range 'Testing' does not exist in the current workbook.
	at org.apache.poi.ss.formula.FormulaParser.parseNameOrCellRef(FormulaParser.java:440)
	at org.apache.poi.ss.formula.FormulaParser.parseRangeExpression(FormulaParser.java:336)
	at org.apache.poi.ss.formula.FormulaParser.parseFunctionReferenceOrName(FormulaParser.java:332)
	at org.apache.poi.ss.formula.FormulaParser.parseSimpleFactor(FormulaParser.java:733)
	at org.apache.poi.ss.formula.FormulaParser.percentFactor(FormulaParser.java:693)
	at org.apache.poi.ss.formula.FormulaParser.powerFactor(FormulaParser.java:680)
	at org.apache.poi.ss.formula.FormulaParser.Term(FormulaParser.java:982)
	at org.apache.poi.ss.formula.FormulaParser.additiveExpression(FormulaParser.java:1083)
	at org.apache.poi.ss.formula.FormulaParser.concatExpression(FormulaParser.java:1067)
	at org.apache.poi.ss.formula.FormulaParser.comparisonExpression(FormulaParser.java:1024)
	at org.apache.poi.ss.formula.FormulaParser.unionExpression(FormulaParser.java:1003)
	at org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:1125)
	at org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:192)
	at org.apache.poi.xssf.usermodel.XSSFName.setRefersToFormula(XSSFName.java:202)
	... 2 more

Expected Results:

Should work, like it does with HSSFWorkbook
Comment 1 Yegor Kozlov 2009-06-10 11:45:51 UTC
Fixed in r783445. The fix will be included in the upcoming 3.5-beta6. 

Regards,
Yegor