You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2009/06/16 18:57:04 UTC

DO NOT REPLY [Bug 47374] New: [Patch] Leave all levels collapsed

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: dev@poi.apache.org
        ReportedBy: julien.bittard@logica.com


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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47374] [Patch] Leave all levels collapsed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47374





--- Comment #1 from julien <ju...@logica.com>  2009-06-16 09:57:44 PST ---
Created an attachment (id=23816)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23816)
The classe RowRecordsAggregate

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47374] [Patch] Leave all levels collapsed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47374


julien <ju...@logica.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|julien.bittard@logica.com   |




-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47374] [Patch] Leave all levels collapsed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47374





--- Comment #3 from julien <ju...@logica.com>  2009-06-17 06:37:58 PST ---
Thank you for your comments. But I think I have not good explain my problem.
In my example, I have one root group, and two sub-group. And when I expand the
root group, the sub-group are also expanded. I attach a file example.
My patch fixes the problem.
In my example the 'rowSumsBelow' property is false.
I hope you understand what I mean.

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47374] [Patch] Leave all levels collapsed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47374


julien <ju...@logica.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |julien.bittard@logica.com




-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47374] [Patch] Leave all levels collapsed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47374





--- Comment #2 from Josh Micich <jo...@gildedtree.com>  2009-06-16 17:02:31 PST ---
Your comment was:
Thanks for the bug-report and suggested fix.  So your proposed change was to
add the line "rowRecord.setColapsed(true);" in collapseRow(int):

    public void collapseRow(int rowNumber) {

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

+        rowRecord.setColapsed(true);
        // Hide all the columns until the end of the group
        int nextRowIx = writeHidden(rowRecord, startRow);


Unfortunately this is NQR.  I think we need to mark the previous row as
'collapsed', not the first row.

For example, with the following POI calls:

    sheet.setRowSumsBelow(false);
    sheet.groupRow(3, 5);
    sheet.setRowGroupCollapsed(3, true);

We should get the following 'outline levels' and flags in the rows:

2 ol=0 collapsed
3 ol=1 hidden
4 ol=1 hidden
5 ol=1 hidden

Currently POI does this:

3 ol=1 hidden
4 ol=1 hidden
5 ol=1 hidden
6 ol=0 collapsed
(Which is actually correct only if sheet.rowSumsBelow == true)

I've done some experimenting with how Excel collapses rows and it appears that
the row with the 'collapsed' flag should appear above *or* below the group
according to the state of the 'rowSumsBelow' flag on the sheet.  POI assumes
the 'collapsed' flag belongs on the group subsequent row which is wrong if
rowSumsBelow is false.

POI should also be changed so that the 'rowSumsBelow' property in HSSFSheet
gets coordinated with the underlying RowRecordsAggregate.  The
RowRecordsAggregate needs to know the value of this flag in order to find the
right row to update the 'collapsed' flag on.  Furthermore, when 'rowSumsBelow'
changes in the sheet, the RowRecordsAggregate will also need to transfer the
'collapsed' flags of each row group accordingly.


Note - Excel's overall model for collapsing row groups works OK as long as
every group has its own dedicated summary row (above or below).  It's not too
hard to create groups that have no summary row, and Excel behaves a little
weirdly in these cases.  POI probably shouldn't bother supporting such
anomalous use cases, and that should be mentioned in the javadoc.

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


removeSlide

Posted by Constantin Volozhin <cv...@pragmaticsoft.com>.
Hi All.
Could anybody of dev look at
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261
?
removeSlide method of SlideShow makes PPT corrupted.
We use POI at production and this issue makes library unusable. 


В Срд, 17/06/2009 в 06:44 -0700, bugzilla@apache.org пишет:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=47374
> 
> 
> 
> 
> 
> --- Comment #4 from julien <ju...@logica.com>  2009-06-17 06:44:53 PST ---
> Created an attachment (id=23824)
>  --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23824)
> test case
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47374] [Patch] Leave all levels collapsed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47374





--- Comment #4 from julien <ju...@logica.com>  2009-06-17 06:44:53 PST ---
Created an attachment (id=23824)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23824)
test case

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org