Bug 43510 - Add support for named ranges in formulas
Summary: Add support for named ranges in formulas
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-dev
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-28 13:38 UTC by Orr Bernstein
Modified: 2008-01-08 07:10 UTC (History)
0 users



Attachments
Replaced the comment in FormulaParser:Ident identifying the need to support named ranges (1.77 KB, patch)
2007-09-28 13:46 UTC, Orr Bernstein
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Orr Bernstein 2007-09-28 13:38:21 UTC
Named ranges can be used in formulas in place of cell/area references or 
literals.  There was a comment in the trunk version of the code about needing 
to add support for this - this bug addresses that need.
Comment 1 Orr Bernstein 2007-09-28 13:46:35 UTC
Created attachment 20895 [details]
Replaced the comment in FormulaParser:Ident identifying the need to support named ranges

This patch implements formula support for named ranges by first identifying
cell references using a regex.	Anything that isn't a cell reference or boolean
literal is then checked against the workbook's set of NameRecords.  If no
NameRecord is found, Abort is called with an error message to that effect. 
Otherwise, a "NamePtg" is added to the tokens list.

The cell reference regex is very liberal in order to support future versions of
Excel. For example, it allows any length sheet name (though Excel 2003 only
supports 31-character sheet names); it allows any number of alphabetical
characters as the column reference (Excel 2007 supports 2^14 columns - three
characters); and it allows any number of digits as the row reference (again,
Excel 2007 supports 2^20 rows - 7 digits).
Comment 2 Nick Burch 2008-01-08 07:10:47 UTC
Thanks for this, committed (had to make a few small tweaks), along with a unit
test for it