特急,如能解决马上给分 很简单 告诉你 例子就免了你的文件格式如下 execl就能打开string1,string2,string3; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 要是想在java里导入就麻烦了需要第三方的支持包 看看apache的poi,专门处理ms office与java的转化的 <servlet与jsp权威指南>上有个例子 ,但我没试成功! 我也在找这方面的资料! http://expert.csdn.net/Expert/topic/2228/2228695.xml?temp=.8008386刚看到的! 使用poi,挺easy的,import org.apache.poi.hssf.usermodel.*;import java.io.FileOutputStream;import java.io.IOException;import java.util.*;public class CreateCells{ public static void main(String[] args) throws IOException{ HSSFWorkbook wb = new HSSFWorkbook();//建立新HSSFWorkbook对象 HSSFSheet sheet = wb.createSheet("new sheet");//建立新的sheet对象 HSSFRow row = sheet.createRow((short)0);//建立新行 HSSFCell cell = row.createCell((short)0);//建立新cell cell.setCellValue(1);//设置cell的整数类型的值 row.createCell((short)0).setCellValue(1.2);//设置cell浮点类型的值 row.createCell((short)1).setCellValue(1.2);//设置cell浮点类型的值 row.createCell((short)2).setCellValue("test");//设置cell字符类型的值 row.createCell((short)3).setCellValue(true);//设置cell布尔类型的值 HSSFCell csCell =row.createCell((short)5); csCell.setEncoding(HSSFCell.ENCODING_UTF_16);//设置cell编码解决中文高位字节截断 csCell.setCellValue("中文测试_Chinese Words Test");//设置中西文结合字符串 row.createCell((short)6).setCellType(HSSFCell.CELL_TYPE_ERROR);//建立错误cell // Write the output to a file FileOutputStream fileOut = new FileOutputStream("workbook.xls"); wb.write(fileOut); fileOut.close(); }} 日程安排如何实现,类似google 日历中的日程 struts分页查询,翻页后条件文本框内容被清空 新手求教,向数据库提交信息时出错。 在做jsp页面时,怎么样判断ie窗口关闭并传给服务器 登录http://localhost:8080/admin/时用户名是什么?存在哪个文件内? 用spring-security-acl-3.1.0.RC1.jar的包做登录,用户名或面面错了,怎么返回提示啊??? 请问如何配置属性文件的相对路径? 才学jsp 奇怪的问题 标签扩展和标签库是作什么用的,能给我简单介绍一下吗? <jsp:useBean>的问题 关于editplus的配置问题
需要第三方的支持包
import org.apache.poi.hssf.usermodel.*;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.*;public class CreateCells{
public static void main(String[] args) throws IOException{
HSSFWorkbook wb = new HSSFWorkbook();//建立新HSSFWorkbook对象
HSSFSheet sheet = wb.createSheet("new sheet");//建立新的sheet对象
HSSFRow row = sheet.createRow((short)0);//建立新行
HSSFCell cell = row.createCell((short)0);//建立新cell
cell.setCellValue(1);//设置cell的整数类型的值
row.createCell((short)0).setCellValue(1.2);//设置cell浮点类型的值
row.createCell((short)1).setCellValue(1.2);//设置cell浮点类型的值
row.createCell((short)2).setCellValue("test");//设置cell字符类型的值
row.createCell((short)3).setCellValue(true);//设置cell布尔类型的值
HSSFCell csCell =row.createCell((short)5);
csCell.setEncoding(HSSFCell.ENCODING_UTF_16);//设置cell编码解决中文高位字节截断
csCell.setCellValue("中文测试_Chinese Words Test");//设置中西文结合字符串
row.createCell((short)6).setCellType(HSSFCell.CELL_TYPE_ERROR);//建立错误cell
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
}
}