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 2013/10/10 02:19:23 UTC

[Bug 55644] New: autoSizeColumn hiding columns

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

            Bug ID: 55644
           Summary: autoSizeColumn hiding columns
           Product: POI
           Version: 3.9
          Hardware: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: gjjagadeesh@gmail.com

I generated one excel file using below program.
When I open excel in Office 2010, then column selected for autoSizeColumn is
hiding.
If I remove the autoSizecolumn, then it works normally.

public class Automation 
{

    public static void main(String[] args) 
    {

        XSSFWorkbook workbook = new XSSFWorkbook();
        XSSFSheet sheet = workbook.createSheet("students");
          XSSFRow row = sheet.createRow(1);
          XSSFCell cell = row.createCell(1);
          cell.setCellValue("sandeepzzzzzzzzzzzzzzzzzzzzzzzzz");
          sheet.autoSizeColumn(1);

        try
        {
            FileOutputStream fileOut = new FileOutputStream("workbook.xlsx");
            workbook.write(fileOut);
            fileOut.close();
        }catch(Exception e)
        {

        }


    }

}

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


[Bug 55644] autoSizeColumn hiding columns

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

Jagadeesh <gj...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |JDK1.5
                 OS|                            |Windows 7

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


[Bug 55644] autoSizeColumn hiding columns

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

--- Comment #5 from Dominik Stadler <do...@gmx.at> ---
Tried with latest trunk and OpenOffice/LibreOffice, but could not reproduce,
will try on Windows with Excel as well.

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


[Bug 55644] autoSizeColumn hiding columns

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

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

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


[Bug 55644] autoSizeColumn hiding columns

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

--- Comment #3 from MS <my...@gmail.com> ---
I'm getting the same behavior using Excel 2013 and poi 3.9
If you set a numeric value (even as a String) then the column is auto-sized
correctly, for example:
cell.setCellValue("12345678987654321");

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


[Bug 55644] autoSizeColumn hiding columns

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

--- Comment #2 from Jagadeesh <gj...@gmail.com> ---
Column is hiding.
After I select the columns and Right click -> Unhide, then I'm able to see the
result.

(In reply to Nick Burch from comment #1)
> Is the column hidden, or just set to a zero width?

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


[Bug 55644] autoSizeColumn hiding columns

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

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #7 from Dominik Stadler <do...@gmx.at> ---
I tried it with Excel 2013, the column is autosized correctly when using POI
3.11-beta2/trunk.

Therefore I am resolving this for now, please reopen with detailed version
information if you still see this problem with recent versions of POI.

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


[Bug 55644] autoSizeColumn hiding columns

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

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #12 from Dominik Stadler <do...@gmx.at> ---
I also think that we rather should require an recently patched version of Java,
therefore closing this WONTFIX for now. There are many security related and
many bug fixes in those newer patchlevels, so upgrading is generally a good
idea.

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


[Bug 55644] autoSizeColumn hiding columns

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

--- Comment #6 from Dirk Dittert <di...@googlemail.com> ---
I have seen this behavior with POI-3.9 as well. Updating to POI-3.10 has
resolved this issue for me.

The columns are not hidden but just have no width. The trick is to select all
columns and then choose Show (last entry of context menu) to make them visible
again.

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


[Bug 55644] autoSizeColumn hiding columns

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

--- Comment #4 from Jonathan Crawford <jc...@leaseaccelerator.com> ---
I am seeing the same behavior with JDK 1.6.0_45.

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


[Bug 55644] autoSizeColumn hiding columns

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

--- Comment #11 from Nick Burch <ap...@gagravarr.org> ---
Upgrading to a non-broken JVM is probably the right fix here!

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


[Bug 55644] autoSizeColumn hiding columns

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

--- Comment #8 from Sebastien Arod <se...@gmail.com> ---
Hi,

I never succeded to reproduce on a dev environment however this seems to always
happen on some customers production environment using POI 3.9 and with
different JVM versions.

I found a Stack Overflow topic that seems to be related to this bug
(stackoverflow.com/a/14389179/1069454)


Is there a known list of steps/conditions required to reproduce this issue?

Could you also please clarify if the issue was reproduced at some point and
fixed in 3.11 or if it was never reproduced by POI team. From the status
(WORKSFORME) I guess it was never reproduced by POI team right?

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


[Bug 55644] autoSizeColumn hiding columns

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

Nick Burch <ap...@gagravarr.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
                 OS|                            |All

--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
Is the column hidden, or just set to a zero width?

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


[Bug 55644] autoSizeColumn hiding columns

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

--- Comment #10 from Sebastien Arod <se...@gmail.com> ---
Debugging shows that using oracle jre 7u21 layout.getBounds().getWidth()
returns 0 in org.apache.poi.ss.util.SheetUtil.getCellWidth(Cell, int,
DataFormatter, boolean)

This may be related to this jdk bug
https://bugs.openjdk.java.net/browse/JDK-8013716.


The problem can be mitigated by detecting when auto sizing fails and using a
minimal width:

sheet.autoSizeColumn(0)
if (sheet.getColumnWidth(0) == 0) {
  // autosize failed use MIN_WIDTH
  sheet.setColumnWidth(0, MIN_WIDTH);
}

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


[Bug 55644] autoSizeColumn hiding columns

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

Sebastien Arod <se...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---

--- Comment #9 from Sebastien Arod <se...@gmail.com> ---
I was able to reproduce the problem using poi 3.9.0, 3.10 and 3.11-beta2 on
windows 7 with oracle jre 7u21. 

This works fine with jre 7u67 on windows 7.

I was not able to reproduce on ubuntu with oracle jre 7u21.

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