Bug 65510 - Add support for XLSB Short Cell Records
Summary: Add support for XLSB Short Cell Records
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: unspecified
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2021-08-19 06:32 UTC by Sheet JS
Modified: 2023-07-10 21:21 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Sheet JS 2021-08-19 06:32:18 UTC
XLSB supports a set of undocumented record types (12-18) which are "short" versions of other cell records.  The short records do not specify a column index.  They assume placement adjacent to the previous cell.

Placement logic: for example, if a BrtCellBlank specifies column D and is followed by a record of type 16 (short BrtCellReal), the new cell will be in column E.

Storage: To explain the file layout, record type 13 is a short form of BrtCellRk (record type 2).  BrtCellRk is a 12 byte structure:

column index (4 bytes)
style index (3 bytes)
flags (1 byte)
value stored as RkNumber (4 bytes)

The short form is an 8 byte structure:

style index (3 bytes)
flags (1 byte)
value stored as RkNumber (4 bytes)

Documentation: Not even the 1.0 MS-XLSB spec mentions those records :( 
 https://oss.sheetjs.com/notes/xlsb_short_records/#records is a small table noting the corresponding records for those record types.

There are two sample files:

https://oss.sheetjs.com/notes/xlsb_short_records/brt_sst.xlsb includes short records for the 5 non-string record types as well as short BrtCellIsst (shared string table)

https://oss.sheetjs.com/notes/xlsb_short_records/brt_str.xlsb includes short records for the 5 non-string record types as well as short BrtCellSt (inline strings)
Comment 1 PJ Fanning 2021-08-19 08:25:04 UTC
Thanks for the detailed report. I'm afraid that xlsb is not a priority for most people in the POI community (because this format is not widely used). This is an open source project and if you are passionate about the xlsb format, code submissions are always welcome.
Comment 2 opeongo 2023-07-07 19:44:16 UTC
I have an itch here and I am willing to take a kick at it.  I am completely new to the POI code base.  Can anyone give me some pointers to help me get up the learning curve, such as where to look to add the short record, debug tools to dump out files, etc.
Comment 3 Dominik Stadler 2023-07-10 21:21:45 UTC
Hi, thanks for the offer of helping out with this feature. 

Please take a look at https://poi.apache.org/devel/index.html for documentation of retrieving and building the source code of Apache POI.

Please use the mailing list listed at https://poi.apache.org/help/index.html for questions/discussion of implementation details.

Finally https://poi.apache.org/devel/guidelines.html describes some best-practices when contributing code.