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

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
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: [hidden email]
          Reporter: [hidden email]
  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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

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

--- Comment #1 from Christian Fröhler <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61454

--- Comment #2 from Christian Fröhler <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61454

--- Comment #3 from Christian Fröhler <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61454

Dominik Stadler <[hidden email]> changed:

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

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61454

Javen O'Neal <[hidden email]> changed:

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

--- Comment #4 from Javen O'Neal <[hidden email]> ---
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@...%3E

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]