Java POI SS问题与Excel大纲和展开/折叠

我遇到了使用POI SS的Excel大纲问题。 我创build了三个“Test1”作为根节点的组。 我使用setRowGroupCollapsed折叠每个组。 但是,当我展开生成的Excel文件上的第一个节点时,所有其他节点也展开。

有没有设置来防止这种情况? 我希望所有级别都崩溃了,如果我扩大第一级,那么下级应该保持崩溃状态,直到我展开为止。

以下是我的testing代码和任何帮助,非常感谢。 提前致谢,

sheet.setAlternativeExpression(false); sheet.setRowSumsBelow(false); Row excelRow = null; Cell excelCell = null; excelRow = sheet.createRow( 0 ); excelCell = excelRow.createCell( 0 ); excelCell.setCellValue( "Test 1" ); excelRow = sheet.createRow( 1 ); excelCell = excelRow.createCell( 1 ); excelCell.setCellValue( "Test 2" ); excelRow = sheet.createRow( 2 ); excelCell = excelRow.createCell( 2 ); excelCell.setCellValue( "Test 3" ); excelRow = sheet.createRow( 3 ); excelCell = excelRow.createCell( 3 ); excelCell.setCellValue( "Test 4" ); sheet.groupRow( 1, 3 ); sheet.groupRow( 2, 3 ); sheet.groupRow( 3, 3 ); sheet.setRowGroupCollapsed( 1, true ); sheet.setRowGroupCollapsed( 2, true ); sheet.setRowGroupCollapsed( 3, true );