-
大小: 11.61MB文件類型: .rar金幣: 1下載: 0 次發(fā)布日期: 2023-07-20
- 語言: Java
- 標簽: Excel2HtmlUt??office??xls轉html??
資源簡介
這款EXCEL轉換HTML利用PIO萬能轉換,來源與CSDN網(wǎng)上資源,我只是吧所有JAR包和程序源碼放在一起便于快速開發(fā)測試使用。本人測試整理好用。
代碼片段和文件信息
package?com.hygx.ldw.text;
/*?====================================================================
???Licensed?to?the?Apache?Software?Foundation?(ASF)?under?one?or?more
???contributor?license?agreements.??See?the?NOTICE?file?distributed?with
???this?work?for?additional?information?regarding?copyright?ownership.
???The?ASF?licenses?this?file?to?You?under?the?Apache?License?Version?2.0
???(the?“License“);?you?may?not?use?this?file?except?in?compliance?with
???the?License.??You?may?obtain?a?copy?of?the?License?at
???????http://www.apache.org/licenses/LICENSE-2.0
???Unless?required?by?applicable?law?or?agreed?to?in?writing?software
???distributed?under?the?License?is?distributed?on?an?“AS?IS“?BASIS
???WITHOUT?WARRANTIES?OR?CONDITIONS?OF?ANY?KIND?either?express?or?implied.
???See?the?License?for?the?specific?language?governing?permissions?and
???limitations?under?the?License.
====================================================================?*/
import?org.apache.poi.hssf.usermodel.HSSFCell;
import?org.apache.poi.hssf.usermodel.HSSFFont;
import?org.apache.poi.hssf.usermodel.HSSFWorkbook;
import?org.apache.poi.ss.examples.html.HSSFHtmlHelper;
import?org.apache.poi.ss.examples.html.HtmlHelper;
import?org.apache.poi.ss.examples.html.XSSFHtmlHelper;
import?org.apache.poi.ss.format.CellFormat;
import?org.apache.poi.ss.format.CellFormatResult;
import?org.apache.poi.ss.usermodel.*;
import?org.apache.poi.xssf.usermodel.XSSFWorkbook;
import?java.io.BufferedReader;
import?java.io.Closeable;
import?java.io.FileInputStream;
import?java.io.FileWriter;
import?java.io.IOException;
import?java.io.InputStream;
import?java.io.InputStreamReader;
import?java.io.PrintWriter;
import?java.util.Formatter;
import?java.util.HashMap;
import?java.util.HashSet;
import?java.util.Iterator;
import?java.util.Map;
import?java.util.Set;
import?static?org.apache.poi.ss.usermodel.Cellstyle.*;
import?org.apache.poi.openxml4j.exceptions.InvalidFormatException;
/**
?*?This?example?shows?how?to?display?a?spreadsheet?in?HTML?using?the?classes?for
?*?spreadsheet?display.
?*?
?*?@author?Ken?Arnold?Industrious?Media?LLC
?*/
public?class?Excel2HtmlUtil
{
????private?final?Workbook?wb;
????private?final?Appendable?output;
????private?boolean?completeHTML;
????private?Formatter?out;
????private?boolean?gotBounds;
????private?int?firstColumn;
????private?int?endColumn;
????private?HtmlHelper?helper;
????private?static?final?String?DEFAULTS_CLASS?=?“excelDefaults“;
????private?static?final?String?COL_HEAD_CLASS?=?“colHeader“;
????private?static?final?String?ROW_HEAD_CLASS?=?“rowHeader“;
????private?static?final?Map?ALIGN?=?mapFor(ALIGN_LEFT?“l(fā)eft“
????????????ALIGN_CENTER?“center“?ALIGN_RIGHT?“right“?ALIGN_FILL?“l(fā)eft“
????????????ALIGN_JUSTIFY?“l(fā)eft“?ALIGN_CENTER_SELECTION?“center“);
????private?static?final?Map?VERTICAL_ALIGN?=?mapFor(
????????????VERTICAL_BOTTOM?“bot
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2320??2013-12-20?22:35??excelst
?????文件???????1194??2016-09-24?20:13??maven配置.txt
?????文件?????232019??2013-10-02?07:14??lib\commons-beanutils-1.8.3.jar
?????文件?????232771??2013-10-02?07:14??lib\commons-codec-1.6.jar
?????文件?????559366??2013-10-02?07:14??lib\commons-collections-3.1.jar
?????文件?????173587??2013-10-02?07:14??lib\commons-io-2.2.jar
?????文件?????279193??2013-10-02?07:14??lib\commons-lang-2.5.jar
?????文件??????60686??2013-10-02?07:14??lib\commons-logging-1.1.1.jar
?????文件?????313898??2013-10-02?07:14??lib\dom4j-1.6.1.jar
?????文件??????86487??2013-10-02?07:14??lib\ezmorph-1.0.6.jar
?????文件?????159123??2013-10-02?07:14??lib\json-lib-2.4-jdk15.jar
?????文件??????16905??2013-10-02?07:14??lib\jstl.jar
?????文件?????358180??2013-10-02?07:14??lib\log4j-1.2.13.jar
?????文件????1820323??2016-04-08?08:26??lib\poi-3.8-20120326.jar
?????文件?????300235??2016-04-08?08:30??lib\poi-examples-3.8-20120326.jar
?????文件??????30446??2016-04-08?08:28??lib\poi-excelant-3.8-20120326.jar
?????文件?????933010??2016-04-08?08:31??lib\poi-ooxm
?????文件????4706775??2016-04-08?08:28??lib\poi-ooxm
?????文件????1186887??2016-04-08?08:32??lib\poi-scratchpad-3.8-20120326.jar
?????文件?????293750??2013-10-02?07:14??lib\standard.jar
?????文件??????26514??2013-10-02?07:14??lib\stax-api-1.0.1.jar
?????文件????2666695??2013-10-02?07:14??lib\xm
?????文件??????16886??2019-01-14?14:31??Excel2HtmlUtil.java
?????目錄??????????0??2019-01-14?14:57??lib
-----------?---------??----------?-----??----
?????????????14457250????????????????????24
評論
共有 條評論