https://issues.apache.org/bugzilla/show_bug.cgi?id=47182
Summary: Link between HSSFCell and StyleRecord is broken
Product: POI
Version: 3.5-dev
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
AssignedTo: [email protected]
ReportedBy: [email protected]
I need the UserStyleName of a cell. But when i call getUserName(), it always
returns null.
// used version: poi-3.5-beta5, jdk1.6.0_04, excel 97
FileInputStream input= new FileInputStream(filename);
HSSFWorkbook worksheet= new HSSFWorkbook(input);
HSSFSheet sheet = worksheet.getSheetAt(0);
HSSFRow row = sheet.getRow(0);
HSSFCell cellBeobachtung= row.getCell(0);
HSSFCellStyle cellStyleBeobachtung= cellBeobachtung.getCellStyle();
System.out.println("cellStyleBeobachtung, user name: " +
cellStyleBeobachtung.getUserStyleName());
After putting some effort in it, I figured out, that the StyleRecord is
correctly constructed (number 231 in the records array). But the xf reference
number is 63 which is a dummy value, indicating that the reference is stored
elsewhere:
OpenOffice, Microsoft Excel File Format, Chapter 2.5.13 Cell Attributes
(BIFF2)
<snip>
If a real XF index greater than 62 is used, the XF index field always
contains the value 63, and an
IXFE record (➜5.62) occurs in front of a cell record. The IXFE record contains
the correct index of the XF record.
<snip>
The method to get the appropriate UserStyleName has two problems. On the one
hand it assumes that all StyleRecords follow directly after the
ExtendenFormatRecords. But there are heaps of UnknownRecords in between the
StyleRecords.
On the other hand are the xf reference numbers which have to treat the number
63 in a different way.
For my excel files, the values are stored in MulRKRecord, there the xf value is
63 (dummy value) and the rk value is 1083088896. Does anybody know what this rk
value means. Can I navigate with this rk value to the StyleRecord?
(I will attach the java source, excel file and 2 printscreens later, since my
internet access is restricted at this place.)
--
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: [email protected]
For additional commands, e-mail: [email protected]