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 2017/08/24 20:23:03 UTC

[Bug 61454] New: [PATCH] Example ToHtml does not respect column width and long cell content breaks html layout

https://bz.apache.org/bugzilla/show_bug.cgi?id=61454

            Bug ID: 61454
           Summary: [PATCH] Example ToHtml does not respect column width
                    and long cell content breaks html layout
           Product: POI
           Version: 3.16-FINAL
          Hardware: PC
            Status: NEW
          Severity: minor
          Priority: P2
         Component: SS Common
          Assignee: dev@poi.apache.org
          Reporter: cfr2017@gmx.net
  Target Milestone: ---

Created attachment 35253
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35253&action=edit
Screenshot of the broken layout - column with long content.

In class org.apache.poi.ss.examples.html.ToHtml POI provides a very good way of
converting Excel sheets to HTML. The resulting html document contains the
correct formatting etc. But column width of the original excel file is not
respeceted; instead the resulting table is formatted with css directive
"table-layout:auto".

In general this is not a problem. Only for there are excel cells with long
content (especially if there are no blanks), the resulting table shows a very
wide column and the remaining columns can only be seen by using the scroll bar.
See attached screenshot.

To fix it, I provide the patch. Patch is based on POI 3.16, but these classes
have not changed since a year or so; therefore it shouldn't be a problem to
apply to 3.18.

-- 
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 61454] [PATCH] Example ToHtml does not respect column width and long cell content breaks html layout

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

--- Comment #3 from Christian Fröhler <cf...@gmx.net> ---
Created attachment 35256
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35256&action=edit
Excel file used for testing

-- 
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 61454] [PATCH] Example ToHtml does not respect column width and long cell content breaks html layout

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

--- Comment #1 from Christian Fröhler <cf...@gmx.net> ---
Created attachment 35254
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35254&action=edit
Proposed patch for Bug 61454 - git patch file

-- 
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 61454] [PATCH] Example ToHtml does not respect column width and long cell content breaks html layout

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

Javen O'Neal <on...@apache.org> changed:

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

--- Comment #4 from Javen O'Neal <on...@apache.org> ---
Thanks for your contribution.

Unfortunately, due to licensing issues, I don't think we can use the
poiWidthToPixels function without the consent of the author.
I've seen several other width to pixel converter codes [1], so it seems there's
no one conversion formula that will work on all systems with the variety of
display resolutions and densities, OS and JVMs, and installed fonts.

I applied your changes with a simplified poiWidthToPixels function in r1808816.

If we can find a conversion formula that works for everybody (or most
everybody), then we should add it somewhere in the main poi package (and
simplify this example). Feel free to open a new bug if you want to suggest a
conversion formula.

[1]
https://mail-archives.apache.org/mod_mbox/poi-user/200810.mbox/%3CBAY124-W1137A2B874ADEEBF932518BA310@phx.gbl%3E

-- 
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 61454] [PATCH] Example ToHtml does not respect column width and long cell content breaks html layout

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

-- 
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 61454] [PATCH] Example ToHtml does not respect column width and long cell content breaks html layout

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

--- Comment #2 from Christian Fröhler <cf...@gmx.net> ---
Created attachment 35255
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35255&action=edit
Screenshot after the fix

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