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 2011/06/11 00:24:34 UTC

DO NOT REPLY [Bug 51356] New: autoSizeColumn in SXSSF-Sheet

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

             Bug #: 51356
           Summary: autoSizeColumn in SXSSF-Sheet
           Product: POI
           Version: 3.8-dev
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SXSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: roland.speckmeier@gmx.de
    Classification: Unclassified


In the SXSSF-Sheet the autoSizeColumn-Method doesn't work.

-- 
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 51356] autoSizeColumn in SXSSF-Sheet

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

--- Comment #2 from Roland Speckmeier <ro...@gmx.de> 2011-06-11 10:12:56 UTC ---
Created attachment 27146
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27146
Test Class for the AutoSizeColumn-Problem in SXXFS-Sheet

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


Re: DO NOT REPLY [Bug 51356] autoSizeColumn in SXSSF-Sheet

Posted by Yegor Kozlov <ye...@dinom.ru>.
My bad, sorry.

On Fri, Feb 3, 2012 at 12:00 PM, Jim Talbut <jt...@spudsoft.co.uk> wrote:
> I already submitted a patch that did this for issue 52314.
> getCellWidth should be in after r1215079.
>
> Check here before doing it again:
> http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java?view=markup&pathrev=1215079
>
> Jim
>
>
> On 03/02/2012 07:27, Yegor Kozlov wrote:
>>
>> You are welcome to upload a patch for SheetUtil.getCellWidth(Workbook
>> wb, Cell cell).
>>
>> In the javadoc you can describe your use case - where this ,method is
>> used and when  SheetUtil.getCellWidth is preferred over
>> SheetUtil.getColumnWidth.
>>
>> Yegor
>>
>> On Thu, Feb 2, 2012 at 4:25 PM, Mike Halma<mi...@proximity.co.uk>
>>  wrote:
>>>
>>> /"Strictly speaking, auto-sizing of columns cannot be supported in SXSSF
>>> becasue
>>> as Dave pointed, this API can only access rows within the sliding
>>> window."/
>>>
>>> True.  However, this was a firm requirement for me.  So I pinched the
>>> code
>>> from org.apache.poi.ss.util.SheetUtil.getColumnWidth() and created a
>>> method
>>> called getCellWidth(Workbook wb, Cell cell).  I call this method for
>>> every
>>> cell I create and maintain an array of max cell size per column in much
>>> the
>>> same way as getColumnWidth() does - manually setting the column widths
>>> once
>>> all cells are created.
>>>
>>> So it might be an idea drop the unfortunately useless method
>>> getColumnWidth
>>> and replace it with a getCellWidth implementation?
>>>
>>> --
>>> View this message in context:
>>> http://apache-poi.1045710.n5.nabble.com/DO-NOT-REPLY-Bug-51356-New-autoSizeColumn-in-SXSSF-Sheet-tp4477454p5450486.html
>>> Sent from the POI - Dev mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
>>> For additional commands, e-mail: dev-help@poi.apache.org
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
>> For additional commands, e-mail: dev-help@poi.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>

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


Re: DO NOT REPLY [Bug 51356] autoSizeColumn in SXSSF-Sheet

Posted by Jim Talbut <jt...@spudsoft.co.uk>.
I already submitted a patch that did this for issue 52314.
getCellWidth should be in after r1215079.

Check here before doing it again: 
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java?view=markup&pathrev=1215079

Jim

On 03/02/2012 07:27, Yegor Kozlov wrote:
> You are welcome to upload a patch for SheetUtil.getCellWidth(Workbook
> wb, Cell cell).
>
> In the javadoc you can describe your use case - where this ,method is
> used and when  SheetUtil.getCellWidth is preferred over
> SheetUtil.getColumnWidth.
>
> Yegor
>
> On Thu, Feb 2, 2012 at 4:25 PM, Mike Halma<mi...@proximity.co.uk>  wrote:
>> /"Strictly speaking, auto-sizing of columns cannot be supported in SXSSF
>> becasue
>> as Dave pointed, this API can only access rows within the sliding window."/
>>
>> True.  However, this was a firm requirement for me.  So I pinched the code
>> from org.apache.poi.ss.util.SheetUtil.getColumnWidth() and created a method
>> called getCellWidth(Workbook wb, Cell cell).  I call this method for every
>> cell I create and maintain an array of max cell size per column in much the
>> same way as getColumnWidth() does - manually setting the column widths once
>> all cells are created.
>>
>> So it might be an idea drop the unfortunately useless method getColumnWidth
>> and replace it with a getCellWidth implementation?
>>
>> --
>> View this message in context: http://apache-poi.1045710.n5.nabble.com/DO-NOT-REPLY-Bug-51356-New-autoSizeColumn-in-SXSSF-Sheet-tp4477454p5450486.html
>> Sent from the POI - Dev mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
>> For additional commands, e-mail: dev-help@poi.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>


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


Re: DO NOT REPLY [Bug 51356] autoSizeColumn in SXSSF-Sheet

Posted by Yegor Kozlov <ye...@dinom.ru>.
You are welcome to upload a patch for SheetUtil.getCellWidth(Workbook
wb, Cell cell).

In the javadoc you can describe your use case - where this ,method is
used and when  SheetUtil.getCellWidth is preferred over
SheetUtil.getColumnWidth.

Yegor

On Thu, Feb 2, 2012 at 4:25 PM, Mike Halma <mi...@proximity.co.uk> wrote:
> /"Strictly speaking, auto-sizing of columns cannot be supported in SXSSF
> becasue
> as Dave pointed, this API can only access rows within the sliding window."/
>
> True.  However, this was a firm requirement for me.  So I pinched the code
> from org.apache.poi.ss.util.SheetUtil.getColumnWidth() and created a method
> called getCellWidth(Workbook wb, Cell cell).  I call this method for every
> cell I create and maintain an array of max cell size per column in much the
> same way as getColumnWidth() does - manually setting the column widths once
> all cells are created.
>
> So it might be an idea drop the unfortunately useless method getColumnWidth
> and replace it with a getCellWidth implementation?
>
> --
> View this message in context: http://apache-poi.1045710.n5.nabble.com/DO-NOT-REPLY-Bug-51356-New-autoSizeColumn-in-SXSSF-Sheet-tp4477454p5450486.html
> Sent from the POI - Dev mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>

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


Re: DO NOT REPLY [Bug 51356] autoSizeColumn in SXSSF-Sheet

Posted by Mike Halma <mi...@proximity.co.uk>.
/"Strictly speaking, auto-sizing of columns cannot be supported in SXSSF
becasue
as Dave pointed, this API can only access rows within the sliding window."/

True.  However, this was a firm requirement for me.  So I pinched the code
from org.apache.poi.ss.util.SheetUtil.getColumnWidth() and created a method
called getCellWidth(Workbook wb, Cell cell).  I call this method for every
cell I create and maintain an array of max cell size per column in much the
same way as getColumnWidth() does - manually setting the column widths once
all cells are created.

So it might be an idea drop the unfortunately useless method getColumnWidth
and replace it with a getCellWidth implementation?

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/DO-NOT-REPLY-Bug-51356-New-autoSizeColumn-in-SXSSF-Sheet-tp4477454p5450486.html
Sent from the POI - Dev mailing list archive at Nabble.com.

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


DO NOT REPLY [Bug 51356] autoSizeColumn in SXSSF-Sheet

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

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Yegor Kozlov <ye...@dinom.ru> 2011-06-11 18:21:54 UTC ---
Fixed in r1134721

Strictly speaking, auto-sizing of columns cannot be supported in SXSSF becasue
as Dave pointed, this API can only access rows within the sliding window. I
changed SXSSF so that it calculates column size for rows in memory, that is,
column size is calculated for rows in the sling window. The result can be
"off", but it is the best I can do.

Yegor

-- 
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 51356] autoSizeColumn in SXSSF-Sheet

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

David Fisher <df...@jmlafferty.com> changed:

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

--- Comment #1 from David Fisher <df...@jmlafferty.com> 2011-06-11 00:28:55 UTC ---
Given the fact that SXSSF works on a sliding window on the file this is not
surprising.

To make it work will likely require multiple passes - or some type of
indication of intent.

Please show us how you are invoking it in code in a simple example.

Regards,
Dave

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