You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2010/09/11 14:48:33 UTC

DO NOT REPLY [Bug 49907] Inconsistent behaviour between HSSF and XSSF when creating consecutive names

https://issues.apache.org/bugzilla/show_bug.cgi?id=49907

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
         OS/Version|                            |All

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2010-09-11 08:48:30 EDT ---
Strictly speaking your code snippet does not make sense. Name's name and
formula MUST be set, otherwise Excel will complain on unreadable content.  

However, it should be possible to create two consecutive names and initialize
them later:

Workbook wb = new HSSFWorkbook(); //or new XSSFWorkook()
Name name1 = wb.createName();
Name name2 = wb.createName();

name1.setNameName("sale_1");
name1.setRefersToFormula(1);

name2.setNameName("sale_2");
name2.setRefersToFormula(2);


The following code works in XSSF but fails in HSSF - checking uniqueness of
names in HSSF is too aggressive. Both should allow creating a pool of names and
initialize them later. 

I committed the fix in r996136. 

Thanks,
Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org