- 浏览: 201223 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
w156445045:
数据全部不要了。
truncate table 表名
用这 ...
SQL Server 自增字段归零(id)从1开始累加 -
unimme:
cas-3.1.1怎么用啊?
在Tomcat中使用Yale CAS实现单点登陆(SSO) 文章合集 -
wait10000y:
...
防止双击Button,点击后让Button失效 -
mamacmm:
支持!
我这有个问题,不知道是否也是CAS的BUG问题:
...
在Tomcat中使用Yale CAS实现单点登陆(SSO) 文章合集 -
InnocentBoy:
不行,我的是5.0它部署的东西在tmp里。
jboss热部署
jxl自带的包里有个公式的demo的,你试试看
--------------------------------------
/*********************************************************************
*
* Copyright (C) 2002 Andrew Khan
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
package jxl.demo;
import java.io.File;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Iterator;
import jxl.Workbook;
import jxl.Sheet;
import jxl.Cell;
import jxl.CellType;
import jxl.FormulaCell;
import jxl.biff.CellReferenceHelper;
import jxl.biff.formula.FormulaParser;
import jxl.biff.formula.ExternalSheet;
import jxl.biff.formula.FormulaException;
/**
* Goes through each cell in the workbook, and if the contents of that
* cell is a formula, it prints out the last calculated value and
* the formula string
*/
public class Formulas
{
/**
* Constructor
*
* @param w The workbook to interrogate
* @param out The output stream to which the CSV values are written
* @param encoding The encoding used by the output stream. Null or
* unrecognized values cause the encoding to default to UTF8
* @exception java.io.IOException
*/
public Formulas(Workbook w, OutputStream out, String encoding)
throws IOException
{
if (encoding == null || !encoding.equals("UnicodeBig"))
{
encoding = "UTF8";
}
try
{
OutputStreamWriter osw = new OutputStreamWriter(out, encoding);
BufferedWriter bw = new BufferedWriter(osw);
ArrayList parseErrors = new ArrayList();
for (int sheet = 0; sheet < w.getNumberOfSheets(); sheet++)
{
Sheet s = w.getSheet(sheet);
bw.write(s.getName());
bw.newLine();
Cell[] row = null;
Cell c = null;
for (int i = 0 ; i < s.getRows() ; i++)
{
row = s.getRow(i);
for (int j = 0; j < row.length; j++)
{
c = row[j];
if (c.getType() == CellType.NUMBER_FORMULA ||
c.getType() == CellType.STRING_FORMULA ||
c.getType() == CellType.BOOLEAN_FORMULA ||
c.getType() == CellType.DATE_FORMULA ||
c.getType() == CellType.FORMULA_ERROR)
{
FormulaCell nfc = (FormulaCell) c;
StringBuffer sb = new StringBuffer();
CellReferenceHelper.getCellReference
(c.getColumn(), c.getRow(), sb);
try
{
bw.write("Formula in " + sb.toString() +
" value: " + c.getContents());
bw.flush();
bw.write(" formula: " + nfc.getFormula());
bw.flush();
bw.newLine();
}
catch (FormulaException e)
{
bw.newLine();
parseErrors.add(sb.toString() + ": " + e.getMessage());
}
}
}
}
}
bw.flush();
bw.close();
if (parseErrors.size() > 0)
{
System.err.println();
System.err.println("There were " + parseErrors.size() + " errors");
Iterator i = parseErrors.iterator();
while (i.hasNext())
{
System.err.println(i.next());
}
}
}
catch (UnsupportedEncodingException e)
{
System.err.println(e.toString());
}
}
}
发表评论
-
使用org.apache.commons.mail发送邮件中文转码问题
2013-04-12 11:21 1658以下内容转自:http://hi.baidu.com/jad ... -
openCSV 开源程序解析CSV文件
2012-12-05 16:39 1058以下内容转自:http://extjs2.iteye.com/ ... -
java发邮件
2010-12-08 15:22 1203以下内容转自:http://wisekingokok.itey ... -
java 破解登陆页面验证码
2009-12-14 16:56 1408http://ishare.iask.sina.com.cn/ ... -
JAVA客户端连接SSL
2009-12-14 16:01 1062以下内容转自:http://ms.mb ... -
浅析J2EE、J2SE和J2ME
2008-12-16 20:19 1309以下内容转自:http://www.itjj.net/tech ... -
java位运算
2008-11-04 18:10 893以下内容转子:http://www.blogjava.net/ ... -
java操作修饰Excel字体大小合并单元格背景色列宽
2008-09-10 17:30 4705原: java操作修饰Excel字体大小合并单元格背景色列宽 ... -
smartupload下载文件使用
2008-09-10 16:52 4602以下内容转自:http://cheerfulmao.bokee ... -
smartupload上传组件使用说明(servlet)
2008-07-22 18:32 1266servlet : import java.io.Buf ... -
java中判断字符串是否为数字的三种方法
2008-07-08 11:50 7611用JAVA自带的函数public static bo ... -
JDK1.5新特性
2008-07-03 16:24 810以下内容引自:http://www ... -
java 日期函数解释
2008-06-18 23:24 1272以下内容引自:http://blog.donews.com/x ... -
java 日期操作函数汇总
2008-06-18 21:17 1498以下内容引自:http://hi.baidu.com/edmo ... -
java 中格式化小数位数
2008-06-18 14:36 4728double d = 221.62999999999997 ... -
Statement和PreparedStatement的比较
2008-06-13 10:13 1012http://www.dingl.com/view.shtml ... -
java 访问Excel使用技巧
2008-06-12 15:23 1078以下内容引自:http://group.qqread.com/ ... -
JDBC连接各种数据库经验及技巧
2008-06-02 14:10 776以下内容,转载于:http://zpchen.iteye.co ... -
java实现定时器功能
2008-05-27 15:12 3166/** * 具体实现类 */import java.util. ...
相关推荐
java利用jxl.jar包读取excel文件
NULL 博文链接:https://zhouyq.iteye.com/blog/272883
jxl读取excel数据(带实例) 里面有一个自己写的实例
利用jxl读取Excel代码的完整内容,包括jar包。包括测试用例,下载后放到eclipse中即可运行,运行主类JHUserImportMgr的main函数即可看到效果。
最近刚好用到jxl来读取Excel表格数据,百度上找遍都找不到jxl的jar包,最后通过其他途径找到了,所以分享一下,让接下来的同学不要费劲找jar包了。
JAVA利用jxl读取Excel所需jar。 JAVA可以利用jxl简单快速的读取excel文件的内容。由于版本限制,只能读取97-03 xls格式的Excel。
NULL 博文链接:https://jsufly.iteye.com/blog/767602
jsp+jspsmart上传+poi3.8读取excel2007+jxl读取excel2003
用jxl读取excel内容的java工程源码,放到eclipse中稍微建立包名即可测试
用jxl读写excel数据,输出图片到excel
包含POI和JXL读取EXCEL数据的工具类(可以直接调用)和需要的工具类
jxl 读取Excel模板并写入数据通用工具类
通过一个小例子了解jxl的读取,使用于java初学者。里面用到的包可以在CSDN下载得到。
jxl 读取2003 excel demo 使用jxl 操作excel
简单的介绍了JXL读写Excel java excle api
java中使用jxl打印excel报表,java中使用jxl打印excel报表,java中使用jxl打印excel报表
jxl读取Excel, 对Excel 进行读写操作
jxl导出excel加水印 WritableWorkbook、WritableSheet、WritableCellFormat
jxl.jar包,以及网络读取Excel文件流所需jar包commons_fileupload,commons_io
在jsp中用Java读取Excel中的数据,以便把该数据写入数据库或jsp页面,对Excel导入很有帮助