锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久亚洲欧洲日产国码农村,国产精品亚洲精品日韩已方,久久国产精品亚洲一区二区http://www.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://www.tkk7.com/Vincent-chenxj/articles/243379.htmlVincent-chenVincent-chenSat, 29 Nov 2008 01:50:00 GMThttp://www.tkk7.com/Vincent-chenxj/articles/243379.htmlhttp://www.tkk7.com/Vincent-chenxj/comments/243379.htmlhttp://www.tkk7.com/Vincent-chenxj/articles/243379.html#Feedback0http://www.tkk7.com/Vincent-chenxj/comments/commentRss/243379.htmlhttp://www.tkk7.com/Vincent-chenxj/services/trackbacks/243379.html闃呰鍏ㄦ枃

]]> - 浣跨敤poi鐢熸垚excel鏂囦歡http://www.tkk7.com/Vincent-chenxj/articles/242581.htmlVincent-chenVincent-chenTue, 25 Nov 2008 08:34:00 GMThttp://www.tkk7.com/Vincent-chenxj/articles/242581.htmlhttp://www.tkk7.com/Vincent-chenxj/comments/242581.htmlhttp://www.tkk7.com/Vincent-chenxj/articles/242581.html#Feedback0http://www.tkk7.com/Vincent-chenxj/comments/commentRss/242581.htmlhttp://www.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://www.tkk7.com/Vincent-chenxj/articles/242520.htmlVincent-chenVincent-chenTue, 25 Nov 2008 05:08:00 GMThttp://www.tkk7.com/Vincent-chenxj/articles/242520.htmlhttp://www.tkk7.com/Vincent-chenxj/comments/242520.htmlhttp://www.tkk7.com/Vincent-chenxj/articles/242520.html#Feedback0http://www.tkk7.com/Vincent-chenxj/comments/commentRss/242520.htmlhttp://www.tkk7.com/Vincent-chenxj/services/trackbacks/242520.html闃呰鍏ㄦ枃

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

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

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

]]> - 浣跨敤POI鐢熸垚Excel鏂囨。騫惰緗墦鍗版牱寮?/title>http://www.tkk7.com/Vincent-chenxj/articles/242491.htmlVincent-chenVincent-chenTue, 25 Nov 2008 03:47:00 GMThttp://www.tkk7.com/Vincent-chenxj/articles/242491.htmlhttp://www.tkk7.com/Vincent-chenxj/comments/242491.htmlhttp://www.tkk7.com/Vincent-chenxj/articles/242491.html#Feedback0http://www.tkk7.com/Vincent-chenxj/comments/commentRss/242491.htmlhttp://www.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://www.tkk7.com/Vincent-chenxj/articles/242474.htmlVincent-chenVincent-chenTue, 25 Nov 2008 02:52:00 GMThttp://www.tkk7.com/Vincent-chenxj/articles/242474.htmlhttp://www.tkk7.com/Vincent-chenxj/comments/242474.htmlhttp://www.tkk7.com/Vincent-chenxj/articles/242474.html#Feedback0http://www.tkk7.com/Vincent-chenxj/comments/commentRss/242474.htmlhttp://www.tkk7.com/Vincent-chenxj/services/trackbacks/242474.html闃呰鍏ㄦ枃

]]>
主站蜘蛛池模板:
性做久久久久免费看|
日本免费久久久久久久网站|
69成人免费视频|
久久精品国产亚洲av影院|
久久国产精品一区免费下载|
亚洲AV无码成人精品区蜜桃|
无码人妻丰满熟妇区免费|
亚洲成人免费在线|
国产精品免费网站|
亚洲人成电影网站久久|
日韩人妻无码免费视频一区二区三区|
国产成人人综合亚洲欧美丁香花|
国产精品免费小视频|
国产99久久久国产精免费|
亚洲精品国产精品乱码视色
|
久久精品国产亚洲AV|
又大又硬又爽免费视频|
国产免费A∨在线播放|
亚洲视频在线一区|
天天拍拍天天爽免费视频|
四虎在线成人免费网站|
亚洲www77777|
亚洲国产精品成人久久蜜臀|
国产在线一区二区综合免费视频|
亚洲精品中文字幕麻豆|
免费人成网站在线高清|
免费在线看污视频|
亚洲综合小说另类图片动图|
国产一区二区三区免费在线观看|
91在线视频免费观看|
亚洲H在线播放在线观看H|
免费v片在线观看品善网|
久久久久久影院久久久久免费精品国产小说
|
亚洲AV无码一区二区乱子伦
|
成人免费一区二区无码视频|
激情婷婷成人亚洲综合|
亚洲av之男人的天堂网站|
日韩中文无码有码免费视频
|
亚洲自偷自偷在线制服|
57pao国产成永久免费视频|
色五月五月丁香亚洲综合网|