Bug 68237 - customHeight attribute of row for SXSSFWorkbook is wrong
Summary: customHeight attribute of row for SXSSFWorkbook is wrong
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 5.3.x-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-27 04:26 UTC by zhonghao
Modified: 2023-11-27 10:33 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhonghao 2023-11-27 04:26:17 UTC
The bug is reported to NPOI:
https://github.com/nissl-lab/npoi/issues/187

The buggy code of NPOI is as follows:

private void BeginRow(int rownum, SXSSFRow row1){
...
WriteAsBytes(OutputStream, " customHeight=\"true\"  ht=\"" + row.HeightInPoints + "\"");...
}

The fixed code of NPOI is as follows:

The buggy code of NPOI is as follows:

private void BeginRow(int rownum, SXSSFRow row1){
...
WriteAsBytes(OutputStream, " customHeight=\"1\"  ht=\"" + row.HeightInPoints + "\"");...
}

Still, I find that POI still sets the attribute to true:

beginRow(int,SXSSFRow)@SheetDataWriter
void beginRow(int rownum, SXSSFRow row) throws IOException {
        _out.write("<row");
        writeAttribute("r", Integer.toString(rownum + 1));
        if (row.hasCustomHeight()) {
            writeAttribute("customHeight", "true");
            writeAttribute("ht", Float.toString(row.getHeightInPoints()));
        }...
}
Comment 1 PJ Fanning 2023-11-27 10:08:32 UTC
added r1914152