• 大小: 9.01MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-10
  • 语言: Java
  • 标签: excel  

资源简介

该技术从国外某网站上整合而来,仅供参考,勉强可以,但仍需完善

资源截图

代码片段和文件信息

package test;

import xls.TableToXls;

import java.util.Scanner;
import java.io.FileOutputStream;

import org.junit.Test;

/**
 * Test by dc
 */
public class TestXls {

@Test
public void run() throws Exception {
StringBuilder html = new StringBuilder();
Scanner s = new Scanner(getClass().getResourceAsStream(“/table.html“)
“utf-8“);
while (s.hasNext()) {
html.append(s.nextLine());
}
s.close();
FileOutputStream fout = new FileOutputStream(“D:/data.xls“);
TableToXls.process(html fout);
fout.close();
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-05-08 14:24  java后台html转excel\
     目录           0  2017-05-08 11:09  java后台html转excel\jar\
     文件      479881  2016-10-13 21:52  java后台html转excel\jar\commons-lang3-3.5.jar
     文件      293672  2013-09-13 15:18  java后台html转excel\jar\jsoup-1.7.2.jar
     目录           0  2017-05-08 14:24  java后台html转excel\TestHtmlToXls\
     文件         841  2015-12-25 14:18  java后台html转excel\TestHtmlToXls\.classpath
     文件        1046  2017-05-08 12:05  java后台html转excel\TestHtmlToXls\.project
     目录           0  2017-05-08 14:24  java后台html转excel\TestHtmlToXls\.settings\
     文件         503  2015-12-25 14:18  java后台html转excel\TestHtmlToXls\.settings\.jsdtscope
     文件         401  2015-12-25 14:18  java后台html转excel\TestHtmlToXls\.settings\org.eclipse.jdt.core.prefs
     文件         475  2015-12-25 14:18  java后台html转excel\TestHtmlToXls\.settings\org.eclipse.wst.common.component
     文件         345  2015-12-25 14:18  java后台html转excel\TestHtmlToXls\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2015-12-25 14:18  java后台html转excel\TestHtmlToXls\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2015-12-25 14:18  java后台html转excel\TestHtmlToXls\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2017-05-08 14:24  java后台html转excel\TestHtmlToXls\build\
     目录           0  2017-05-08 14:24  java后台html转excel\TestHtmlToXls\build\classes\
     文件        2026  2017-05-08 12:02  java后台html转excel\TestHtmlToXls\build\classes\sample.html
     文件        1354  2017-05-08 12:27  java后台html转excel\TestHtmlToXls\build\classes\table.html
     目录           0  2017-05-08 14:24  java后台html转excel\TestHtmlToXls\build\classes\test\
     文件        1313  2017-05-08 12:27  java后台html转excel\TestHtmlToXls\build\classes\test\TestXls.class
     目录           0  2017-05-08 14:24  java后台html转excel\TestHtmlToXls\build\classes\xls\
     目录           0  2017-05-08 14:24  java后台html转excel\TestHtmlToXls\build\classes\xls\resource\
     文件        1637  2017-05-08 12:05  java后台html转excel\TestHtmlToXls\build\classes\xls\resource\CssApplier.class
     文件        6927  2017-05-08 12:05  java后台html转excel\TestHtmlToXls\build\classes\xls\resource\CssUtils.class
     目录           0  2017-05-08 14:24  java后台html转excel\TestHtmlToXls\build\classes\xls\resource\support\
     文件        2272  2017-05-08 12:05  java后台html转excel\TestHtmlToXls\build\classes\xls\resource\support\AlignApplier.class
     文件        2873  2017-05-08 12:05  java后台html转excel\TestHtmlToXls\build\classes\xls\resource\support\BackgroundApplier.class
     文件        6751  2017-05-08 12:05  java后台html转excel\TestHtmlToXls\build\classes\xls\resource\support\BorderApplier.class
     文件        2067  2017-05-08 12:05  java后台html转excel\TestHtmlToXls\build\classes\xls\resource\support\HeightApplier.class
     文件        8293  2017-05-08 12:05  java后台html转excel\TestHtmlToXls\build\classes\xls\resource\support\TextApplier.class
     文件        2178  2017-05-08 12:05  java后台html转excel\TestHtmlToXls\build\classes\xls\resource\support\WidthApplier.class
............此处省略36个文件信息

评论

共有 条评论