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

           Summary: [Patch] Leave all levels collapsed
           Product: POI
           Version: 3.2-FINAL
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [email protected]


I create three groups being the root node. I collapse each group as well using
setRowGroupCollapsed. However, when I expand the first node on the Excel File
generated, all the other nodes are also expanded.
To prevent this I apply this patch in the class
org.apache.poi.hssf.record.aggregates.RowRecordsAggregate, method collapseRow :

 public void collapseRow( int rowNumber )
    {
        // Find the start of the group.
        int startRow = findStartOfRowOutlineGroup( rowNumber );
        RowRecord rowRecord = getRow( startRow );

        //I add this line
        rowRecord.setColapsed(true);


        // Hide all the columns until the end of the group
        int lastRow = writeHidden( rowRecord, startRow, true );

        // Write collapse field
        if (getRow(lastRow + 1) != null)
        {
            getRow(lastRow + 1).setColapsed( true );
        }
        else
        {
            RowRecord row = createRow( lastRow + 1);
            row.setColapsed( true );
            insertRow( row );
        }
    }

-- 
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]

Reply via email to