ASF Bugzilla – Attachment 16399 Details for
Bug 36646
FormulaEvaluator fails to handle properly quoted spaces in cell reference sheet name for Excel 2002 SP1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Code that reproduces problem. In default package.
SpaceInRefNameTest.java (text/plain), 1.62 KB, created by
John Broglio
on 2005-09-14 00:41:23 UTC
(
hide
)
Description:
Code that reproduces problem. In default package.
Filename:
MIME Type:
Creator:
John Broglio
Created:
2005-09-14 00:41:23 UTC
Size:
1.62 KB
patch
obsolete
>/** SpaceInRefNameTest > * > * Copyright (c) GameTable Online, Inc. Sep 13, 2005 > * (Created with IntelliJ IDEA.) > * author: jbroglio > * Date: Sep 13, 2005 > * Time: 5:32:24 PM > * > */ > >import org.apache.poi.poifs.filesystem.POIFSFileSystem; >import org.apache.poi.hssf.usermodel.HSSFWorkbook; >import org.apache.poi.hssf.usermodel.HSSFSheet; >import org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator; >import org.apache.poi.hssf.usermodel.HSSFRow; >import org.apache.poi.hssf.usermodel.HSSFCell; > >import java.io.IOException; >import java.io.FileInputStream; > >/** This class tests a space in a reference name. It accompanies a minimal > * excel file with the same name. > * Problem: The scratchpad HSSFFormulaEvaluator does not handle a space in > * a reference name properly, even though the name is properly enclosed in > * guarding single quotes. > */ >public class SpaceInRefNameTest >{ > public static void main(String[] args) throws IOException > { > POIFSFileSystem fs = > new POIFSFileSystem(new FileInputStream( > "SpaceInRefNameTest.xls")); > HSSFWorkbook wb = new HSSFWorkbook(fs); > HSSFSheet attackSheet; > HSSFSheet sheet; > sheet = wb.getSheet("Sheet 1"); > // read names > HSSFFormulaEvaluator feval = new HSSFFormulaEvaluator(sheet, wb); > HSSFRow row = sheet.getRow(1); > HSSFCell cell = row.getCell((short)0); > feval.setCurrentRow(row); > System.out.println("Formula: "+cell.getCellFormula()); > System.out.flush(); > System.out.println("Eval: "+ feval.evaluate(cell).getNumberValue()); > } >} > >//$Log: $
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 36646
:
16398
| 16399 |
16407