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 2010/04/07 23:51:27 UTC
DO NOT REPLY [Bug 49066] New: [PATCH] worksheet/cell formatting,
with view and HTML converter
https://issues.apache.org/bugzilla/show_bug.cgi?id=49066
Summary: [PATCH] worksheet/cell formatting, with view and HTML
converter
Product: POI
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
AssignedTo: dev@poi.apache.org
ReportedBy: arnold@moonhill.org
Created an attachment (id=25244)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=25244)
Patch and new files
This patch has updated org.apache.poi.hssf.contrib.view.SViewer to include the
ability to handle most border types, cell formats, and conditional formatting.
The cell formats include almost all formats as excel understands them for
numbers, dates, and strings. The only format parts that aren't handled are
those that require the width of the cell in characters. These classes are
separated out so they can be used in other contexts (see below).
The viewer panel and the JTable for showing the spreadsheet are built as
separate components that can be used in other applications.
The tests for excel formats are done by comparison to the actual results of
using the formats in an excel spreadsheet — that is, the tests compare the
results of the formatting with a row in a spreadsheet that formats the same
number according to the same format.
The same is done for conditional formatting.
Besides the view, a new example is provided that converts an spreadsheet into
HTML (read-only). This can be included in any HTML page.
(The formatting stuff in Excel is very picky and very poorly documented, but I
tried to be as exhaustive as I could be.)
[Hm. The instruction say to upload both patch and tar files, but bugzilla
seems to be allowing me to only upload one file. I have therefore put the
"diff.txt" file into the tar.]
--
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 49066] [PATCH] worksheet/cell formatting, with
view and HTML converter
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49066
Yegor Kozlov <ye...@dinom.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2010-05-10 12:14:30 EDT ---
Thanks for the excellent patch. Sorry it took so long to review and apply.
I committed it in r942809 with some tweaks:
(1) The poi-contrib module is obsolete. Eventually, all its contents will be
repackaged and the module itself will be zapped.
I put org.apache.poi.ss.format.* in poi-main, it is a general-purpose code
that can be re-used across POI. ToHtml and SViewer were moved to poi-examples.
(2) SVSheetTable#setupScroll(JScrollPane scroll) did not compile. The problem
line was
SVRowHeader rowHeader = new SVRowHeader(sheet, this);
The constructor of SVRowHeader takes 3 arguments and I changed it to
SVRowHeader rowHeader = new SVRowHeader(sheet, this, 0);
Please confirm that it makes sense.
(3) I added the Apache Licence Header to almost all new classes. ASF header is
a must.
(4) org.apache.poi.ss.format.CellNumberFormatter depends on a class from
Apache Commons-Math. I would rather avoid dependency on the Commons-Math jar
and created an inner class CellNumberFormatter.Fraction based on
org.apache.commons.math.fraction.Fraction. When POI uses more classes from
Commons-Math then I'm OK to drop this inner class and use Commons-Math, but for
a single dependency and I would rather duplicate code.
(5) The preferred way of constructing Workbook from the given InputStream is
to use WorkbookFactory.create(InputStream in). I changed ToHtml to use
WorkbookFactory and removed ToHtml#createXSSF and ToHtml#createHSSF.
(6) By convention, names of test classes start with Test*, the build script
runs junit only for files matching "**/Test*.java" . I renamed classes in
org.apache.poi.ss.format.* to follow this convention.
Other than that, very cool! Thanks again.
Regards,
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 49066] [PATCH] worksheet/cell formatting, with
view and HTML converter
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49066
Ken Arnold <ar...@moonhill.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |arnold@moonhill.org
--
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 49066] [PATCH] worksheet/cell formatting, with
view and HTML converter
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49066
--- Comment #2 from Ken Arnold <ar...@moonhill.org> 2010-05-13 11:53:20 EDT ---
Yes, that all looks fine. Thanks!
--
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