锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久亚洲欧洲日产国码农村,国产精品亚洲精品日韩已方,久久国产精品亚洲一区二区http://m.tkk7.com/Vincent-chenxj/category/36210.htmlzh-cnSat, 29 Nov 2008 13:03:30 GMTSat, 29 Nov 2008 13:03:30 GMT60- 浣跨敤POI鏉ュ鐞咵xcel鍜學ord鏂囦歡鏍煎紡http://m.tkk7.com/Vincent-chenxj/articles/243379.htmlVincent-chenVincent-chenSat, 29 Nov 2008 01:50:00 GMThttp://m.tkk7.com/Vincent-chenxj/articles/243379.htmlhttp://m.tkk7.com/Vincent-chenxj/comments/243379.htmlhttp://m.tkk7.com/Vincent-chenxj/articles/243379.html#Feedback0http://m.tkk7.com/Vincent-chenxj/comments/commentRss/243379.htmlhttp://m.tkk7.com/Vincent-chenxj/services/trackbacks/243379.html闃呰鍏ㄦ枃

]]> - 浣跨敤poi鐢熸垚excel鏂囦歡http://m.tkk7.com/Vincent-chenxj/articles/242581.htmlVincent-chenVincent-chenTue, 25 Nov 2008 08:34:00 GMThttp://m.tkk7.com/Vincent-chenxj/articles/242581.htmlhttp://m.tkk7.com/Vincent-chenxj/comments/242581.htmlhttp://m.tkk7.com/Vincent-chenxj/articles/242581.html#Feedback0http://m.tkk7.com/Vincent-chenxj/comments/commentRss/242581.htmlhttp://m.tkk7.com/Vincent-chenxj/services/trackbacks/242581.htmlpoi鏄痑pache鍩洪噾涓嬮潰鐨勪竴涓紑婧愰」鐩紝鍦╗url]http://www.apache.org/dyn/closer.cgi/jakarta/poi/[/url] 鍙互涓嬭澆鍒皃oi鐨勫寘
涓嬭澆浠ュ悗鎶婅В鍘嬪緱鍒扮殑鏂囦歡鍔犲埌web-inf涓嬮潰鐨刲ib鐩綍涓嬮潰灝卞彲浠ヤ嬌鐢ㄤ簡銆?br />
涓嬮潰鍏堜粙緇嶄竴涓嬬敓鎴恊xcel鏂囦歡瑕佺敤鐨勭被錛?br />
HSSFWorkbook 鐢ㄤ簬鍒涘緩excel鏂囦歡
HSSFSheet 鐢ㄤ簬鍒涘緩excel鐨勪功鍐?br />
HSSFRow 鐢ㄤ簬鍒涘緩涓琛?br />
HSSFCell 鐢ㄤ簬鍒涘緩涓涓崟鍏冩牸
HSSFCellStyle 鐢ㄤ簬鍒涘緩涓涓崟鍏冩牸鐨勬牸寮?br />
HSSFFont 鐢ㄤ簬鍒涘緩涓涓崟鍏冩牸鐨勫瓧浣撴牸寮?br />
涓嬮潰鐢ㄦ湰浜哄啓鐨勪竴涓氱敤鐨勫伐鍏風被浣滀負渚嬪瓙璇存槑涓涓嬬敓鎴愭枃浠剁殑鏂規硶
錛堣繖閲屽彧鍒楀嚭閮ㄥ垎浠g爜錛岃緇嗙殑璇風湅闄勪歡鐨勬簮鐮侊紝濡傛灉瑕佷嬌鐢ㄩ檮浠剁殑浠g爜錛岃淇濈暀鍘熷垱浜虹殑鍚嶅瓧錛?br />
public String createFile(List<Hashtable> hlist)//鏍規嵁浼犲叆鐨勫弬鏁拌鍙栨暟鎹紝榪欓噷鐢ㄤ簡鑼冨瀷鎸囧畾鍙傛暟鏄痟ashtable綾誨瀷鐨刲ist


{
HSSFWorkbook wb = new HSSFWorkbook();//鍒涘緩excel鏂囦歡
for(int hcount=0;hcount<hlist.size();hcount++)


{
Hashtable ha = hlist.get(hcount);//鑾峰彇絎琱count涓厓绱?/span>
HSSFSheet sheettemp = wb.createSheet();
wb.setSheetName(hcount,(String)ha.get("name"),(short)1);//鏂板緩涓涓猻heet
HSSFRow rowtitle = sheettemp.createRow((short)0);//娣誨姞琛ㄥご
HSSFCell celltitle = rowtitle.createCell((short)0);
celltitle.setEncoding(HSSFCell.ENCODING_UTF_16);//璁劇疆瀛椾綋緙栫爜
celltitle.setCellValue((String)ha.get("title"));//璁劇疆琛ㄥご鍐呭
rowtitle = sheettemp.createRow((short)1);//鏂板涓琛岀敤浜庡瓨鏀捐〃澶村唴瀹?/span>
String[] fields = (String[])ha.get("field");//鑾峰彇鍒楀ご
sheettemp.addMergedRegion(new Region(0,(short)0,0,(short)(fields.length-1)));//鍚堝茍絎竴琛?/span>
rowtitle = sheettemp.getRow(0);//鑾峰緱絎竴琛岀殑寮曠敤
celltitle = rowtitle.getCell((short)0);//鑾峰緱絎竴琛岀涓涓崟鍏冩牸鐨勫紩鐢?/span>
setTitleStyle(wb,celltitle);//璁劇疆琛ㄥご鏍煎紡
HSSFRow rowfield = sheettemp.createRow((short)1);//鏂板涓琛岀敤浜庡瓨鏀懼垪澶村唴瀹?/span>
for(int i = 0;i<fields.length;i++)//鏍規嵁鑾峰彇鍒扮殑鍒楀ご鏁版嵁錛屽驚鐜緗垪澶寸殑鍐呭

{
HSSFCell cellfield = rowfield.createCell((short)i);
cellfield.setEncoding(HSSFCell.ENCODING_UTF_16);
cellfield.setCellValue(fields[i]);
setFieldStyle(wb,cellfield);//璁劇疆鍒楀ご鏍煎紡
int xx = cellfield.getStringCellValue().length();
sheettemp.setColumnWidth((short) i,(short)(600*xx));
}
List listtemp = (List)ha.get("body");//鑾峰彇琛ㄦ牸鍐呭
Object[] rowtemp = null;
int count = 0;
for(Iterator it = listtemp.iterator();it.hasNext();)//榪唬鐢熸垚鏁版嵁

{
rowtemp = (Object[])it.next();
HSSFRow rowbody = sheettemp.createRow((short)(count+2));
for(int i = 0;i<rowtemp.length;i++)

{
HSSFCell cellbody = rowbody.createCell((short)i);
cellbody.setEncoding(HSSFCell.ENCODING_UTF_16);
cellbody.setCellValue((String)rowtemp[i]);
}
count++;
}
}
FileOutputStream fileOut;

try
{
fileOut = new FileOutputStream(setFilepath());//鐢熸垚鏂囦歡

try
{
wb.write(fileOut);

} catch (IOException e)
{
System.out.println(e.toString());
}

try
{
fileOut.close();

} catch (IOException e)
{
System.out.println(e.toString());
}

} catch (FileNotFoundException e)
{
System.out.println(e.toString());
}
return filename;
}


鏈鍚庤鏄庝竴涓嬮檮浠剁殑鍚勪釜綾葷殑浣滅敤錛?br />
Report.java 鎺ュ彛綾伙紝鎵鏈夌殑鑾峰彇鏁版嵁鐨勭被蹇呴』瀹炵幇榪欎釜鎺ュ彛錛屼互渚跨敓鎴愭枃浠舵椂緇熶竴綆$悊錛?br />
ExcelContent.java 瀹炵幇浜哛eport鎺ュ彛錛岃礋璐h幏鍙栨暟鎹茍緇勮鍒癶ashtable錛?br />
ReportTool.java 鏍規嵁浼犲叆鐨勫弬鏁扮敓鎴恊xcel鏂囦歡錛屽茍榪斿洖鐢熸垚鐨勬枃浠跺悕錛?br />
CreateReport.java 琚閮ㄧ▼搴忚皟鐢紝璐熻矗鑾峰彇鏁版嵁鍜屾妸鏁版嵁浼犻掔粰ReportTool錛屾渶鍚庣敓鎴恊xcel鏂囦歡錛岃繑鍥炵敓鎴愮殑鏂囦歡鍚嶇粰璋冪敤鑰呫?/font>

]]> - java瀵煎叆瀵煎嚭excel鎿嶄綔(jxl)http://m.tkk7.com/Vincent-chenxj/articles/242520.htmlVincent-chenVincent-chenTue, 25 Nov 2008 05:08:00 GMThttp://m.tkk7.com/Vincent-chenxj/articles/242520.htmlhttp://m.tkk7.com/Vincent-chenxj/comments/242520.htmlhttp://m.tkk7.com/Vincent-chenxj/articles/242520.html#Feedback0http://m.tkk7.com/Vincent-chenxj/comments/commentRss/242520.htmlhttp://m.tkk7.com/Vincent-chenxj/services/trackbacks/242520.html闃呰鍏ㄦ枃

]]> - java鎶ヨ〃JXL鍜孭OI鎵撳嵃璁劇疆http://m.tkk7.com/Vincent-chenxj/articles/242512.htmlVincent-chenVincent-chenTue, 25 Nov 2008 04:59:00 GMThttp://m.tkk7.com/Vincent-chenxj/articles/242512.htmlhttp://m.tkk7.com/Vincent-chenxj/comments/242512.htmlhttp://m.tkk7.com/Vincent-chenxj/articles/242512.html#Feedback0http://m.tkk7.com/Vincent-chenxj/comments/commentRss/242512.htmlhttp://m.tkk7.com/Vincent-chenxj/services/trackbacks/242512.html闃呰鍏ㄦ枃

]]> - 涓姝ヤ竴姝ヤ嬌鐢≒OI鍋歫ava鎶ヨ〃http://m.tkk7.com/Vincent-chenxj/articles/242510.htmlVincent-chenVincent-chenTue, 25 Nov 2008 04:50:00 GMThttp://m.tkk7.com/Vincent-chenxj/articles/242510.htmlhttp://m.tkk7.com/Vincent-chenxj/comments/242510.htmlhttp://m.tkk7.com/Vincent-chenxj/articles/242510.html#Feedback0http://m.tkk7.com/Vincent-chenxj/comments/commentRss/242510.htmlhttp://m.tkk7.com/Vincent-chenxj/services/trackbacks/242510.html闃呰鍏ㄦ枃

]]> - 涓姝ヤ竴姝ヤ嬌鐢≒OI鍋歫ava鎶ヨ〃--鎵撳嵃璁劇疆綃?/title>http://m.tkk7.com/Vincent-chenxj/articles/242499.htmlVincent-chenVincent-chenTue, 25 Nov 2008 04:01:00 GMThttp://m.tkk7.com/Vincent-chenxj/articles/242499.htmlhttp://m.tkk7.com/Vincent-chenxj/comments/242499.htmlhttp://m.tkk7.com/Vincent-chenxj/articles/242499.html#Feedback0http://m.tkk7.com/Vincent-chenxj/comments/commentRss/242499.htmlhttp://m.tkk7.com/Vincent-chenxj/services/trackbacks/242499.html闃呰鍏ㄦ枃

]]> - 浣跨敤POI鐢熸垚Excel鏂囨。騫惰緗墦鍗版牱寮?/title>http://m.tkk7.com/Vincent-chenxj/articles/242491.htmlVincent-chenVincent-chenTue, 25 Nov 2008 03:47:00 GMThttp://m.tkk7.com/Vincent-chenxj/articles/242491.htmlhttp://m.tkk7.com/Vincent-chenxj/comments/242491.htmlhttp://m.tkk7.com/Vincent-chenxj/articles/242491.html#Feedback0http://m.tkk7.com/Vincent-chenxj/comments/commentRss/242491.htmlhttp://m.tkk7.com/Vincent-chenxj/services/trackbacks/242491.html 1
package test;
2
3
import java.io.FileOutputStream;
4
import java.io.IOException;
5
6
import org.apache.poi.hssf.usermodel.HSSFCell;
7
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
8
import org.apache.poi.hssf.usermodel.HSSFFont;
9
import org.apache.poi.hssf.usermodel.HSSFPrintSetup;
10
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
11
import org.apache.poi.hssf.usermodel.HSSFRow;
12
import org.apache.poi.hssf.usermodel.HSSFSheet;
13
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
14
15
public class ExcelTest
{
16
17
public static void main(String[] args) throws IOException
{
18
19
// create a new file
20
FileOutputStream out = new FileOutputStream("D:/workbook.xls");
21
// create a new workbook
22
HSSFWorkbook wb = new HSSFWorkbook();
23
// create a new sheet
24
HSSFSheet sheet = wb.createSheet();
25
26
//2.model
27
HSSFRow row = sheet.createRow(2);
28
row.setHeightInPoints(20);
29
HSSFCell cell = row.createCell(2);
30
HSSFFont cnFont = wb.createFont();
31
cnFont.setFontHeightInPoints((short) 10);
32
//font.setFontName("姹変華鎶ュ畫綆");
33
cnFont.setFontName("闅朵功");
34
HSSFCellStyle cnStyle = wb.createCellStyle();
35
cnStyle.setFont(cnFont);
36
cell.setCellStyle(cnStyle);
37
HSSFRichTextString richText = new HSSFRichTextString("涓枃瀛椾綋嫻嬭瘯");
38
cell.setCellValue(richText);
39
HSSFCell enCell = row.createCell(3);
40
HSSFFont enFont = wb.createFont();
41
enFont.setFontHeightInPoints((short) 10);
42
enFont.setFontName("Arial Black");
43
HSSFCellStyle enStyle = wb.createCellStyle();
44
enStyle.setFont(enFont);
45
enCell.setCellStyle(enStyle);
46
enCell.setCellValue(new HSSFRichTextString("English font test"));
47
sheet.setColumnWidth(2, 4000);
48
sheet.setColumnWidth(3, 4000);
49
50
//3.output
51
sheet.setDisplayGridlines(false);
52
sheet.setPrintGridlines(false);
53
HSSFPrintSetup printSetup = sheet.getPrintSetup();
54
//A4綰?/span>
55
printSetup.setPaperSize(HSSFPrintSetup.A4_PAPERSIZE);
56
wb.write(out);
57
out.close();
58
}
59
}
60

]]> - POI瀹炵幇Excel鎻掑叆鍥劇墖http://m.tkk7.com/Vincent-chenxj/articles/242474.htmlVincent-chenVincent-chenTue, 25 Nov 2008 02:52:00 GMThttp://m.tkk7.com/Vincent-chenxj/articles/242474.htmlhttp://m.tkk7.com/Vincent-chenxj/comments/242474.htmlhttp://m.tkk7.com/Vincent-chenxj/articles/242474.html#Feedback0http://m.tkk7.com/Vincent-chenxj/comments/commentRss/242474.htmlhttp://m.tkk7.com/Vincent-chenxj/services/trackbacks/242474.html闃呰鍏ㄦ枃

]]>
主站蜘蛛池模板:
91嫩草国产在线观看免费|
亚洲AⅤ永久无码精品AA
|
亚洲综合综合在线|
成人au免费视频影院|
一区二区三区免费视频网站|
亚洲AV人无码综合在线观看|
天天拍拍天天爽免费视频|
99视频在线观看免费|
亚洲性无码AV中文字幕|
亚洲精品国产品国语在线|
中文字幕影片免费在线观看|
精品国产呦系列在线观看免费|
亚洲国产精品日韩在线|
亚洲精品乱码久久久久久不卡|
亚州免费一级毛片|
国产区在线免费观看|
亚洲一久久久久久久久|
久久亚洲AV午夜福利精品一区|
啦啦啦在线免费视频|
一区二区三区福利视频免费观看|
色偷偷尼玛图亚洲综合|
2022年亚洲午夜一区二区福利|
国产最新凸凹视频免费|
2021国内精品久久久久精免费|
午夜在线免费视频
|
最近2019中文字幕mv免费看|
国产综合免费精品久久久|
久久精品熟女亚洲av麻豆|
亚洲欧洲日韩国产|
亚洲精品无码久久久久去q|
男女啪啪永久免费观看网站|
88av免费观看|
手机看片国产免费永久|
美女无遮挡免费视频网站|
国产精品久久亚洲不卡动漫|
亚洲日韩区在线电影|
国产亚洲精午夜久久久久久|
国产人成免费视频|
成人毛片18女人毛片免费视频未
|
国产福利在线观看免费第一福利|
在线观看免费黄网站|