javaÖÐjxlµ¼³öÊý¾Ýµ½excelµÄÀý×Ó
¹Ø¼ü×Ö: javaÖÐjxlµ¼³öÊý¾Ýµ½excelµÄÀý×Ó
ÒªÍùxlsÎļþÀïÃæдÈëÊý¾ÝµÄʱºòÐèҪעÒâµÄÊǵÚһҪн¨Ò»¸öxlsÎļþ
OutputStream os=new FileOutputStream("c:\\excel2.xls" );
ÔÙ½¨ÍêÕâ¸öÎļþµÄʱºòÔÙ½¨Á¢¹¤×÷Îļþ
jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(new File(os));
Èç¹ûÕâ¸öÎļþÒѾ´æÔÚ,ÄÇôÎÒÃÇ¿ÉÒÔÔÚÕâ¸öÎļþÀïÃæ¼ÓÈëÒ»¸ösheetΪÁ˺ÍÒÔÇ°µÄÊý¾Ý½øÐзֿª;
jxl.write.WritableSheet ws = wwb.createSheet("Test Sheet 1" , 0);
ÔÚcreateSheet·½·¨ÀïÇ°ÃæµÄ²ÎÊýÊÇsheetÃû£¬ºóÃæÊÇÒª²Ù×÷µÄsheetºÅ
½ÓÏÂÀ´¾Í¿ÉÒÔÍùÕâ¸öÎļþÀïÃæдÈëÊý¾ÝÁË
дÈëÊý¾ÝµÄʱºò×¢ÒâµÄ¸ñʽ
£¨1£©Ìí¼ÓµÄ×ÖÌåÑùʽ
jxl.write.WritableFont wf = new jxl.write.WritableFont(WritableFont.TIMES, 18, WritableFont.BOLD, true);
WritableFont()·½·¨Àï²ÎÊý˵Ã÷£º
Õâ¸ö·½·¨ËãÊÇÒ»¸öÈÝÆ÷£¬¿ÉÒԷŽøÈ¥ºÃ¶àÊôÐÔ
µÚÒ»¸ö: TIMESÊÇ×ÖÌå´óС£¬ËûдµÄÊÇ18
µÚ¶þ¸ö: BOLDÊÇÅжÏÊÇ·ñΪбÌå,Ñ¡ÔñtrueʱΪбÌå
µÚÈý¸ö: ARIAL
µÚËĸö: UnderlineStyle.NO_UNDERLINE Ï»®Ïß
µÚÎå¸ö: jxl.format.Colour.RED ×ÖÌåÑÕÉ«ÊǺìÉ«µÄ
jxl.write.WritableCellFormat wcfF = new jxl.write.WritableCellFormat(wf);
jxl.write.Label labelC = new jxl.write.Label(0, 0, "This is a Label cell" £¬wcfF);
ws.addCell(labelC);
ÔÚLabel()·½·¨ÀïÃæÓÐÈý¸ö²ÎÊý
µÚÒ»¸öÊÇ´ú±íÁÐÊý,
µÚ¶þÊÇ´ú±íÐÐÊý£¬
µÚÈý¸ö´ú±íҪдÈëµÄÄÚÈÝ
µÚËĸöÊÇ¿ÉÑ¡ÏÊÇÊäÈëÕâ¸ölabelÀïÃæµÄÑùʽ
È»ºóͨ¹ýдsheetµÄ·½·¨addCell£¨£©°ÑÄÚÈÝд½øsheetÀïÃæ¡£
£¨2£©Ìí¼Ó´øÓÐformattingµÄNumber¶ÔÏó
jxl.write.NumberFormat nf = new jxl.write.NumberFormat("#.##" );
£¨3£©Ìí¼ÓNumber¶ÔÏó
£¨3.1£©ÏÔʾnumber¶ÔÏóÊý¾ÝµÄ¸ñʽ
jxl.write.NumberFormat nf = new jxl.write.NumberFormat("#.##" );
jxl.write.WritableCellFormat wcfN = new jxl.write.WritableCellFormat(nf);
jxl.write.Number labelNF = new jxl.write.Number(1, 1, 3.1415926, wcfN);
ws.addCell(labelNF);
Number()·½·¨²ÎÊý˵Ã÷:
Ç°Á½ÉϱíʾÊäÈëµÄλÖÃ
µÚÈý¸ö±íʾÊäÈëµÄÄÚÈÝ
£¨4£©Ìí¼ÓBoolean¶ÔÏó
jxl.write.Boolean labelB = new jxl.write.Boolean(0, 2, false);
ws.addCell(labelB);
£¨5£©Ìí¼ÓDateTime¶ÔÏó
jxl.write.DateTime labelDT = new jxl.write.DateTime(0,
Ïà¹ØÎĵµ£º
×öÁËÒ»¸öºÜ¼òµ¥µÄ½çÃæ³ÌÐò,Ò²ÊÇÎÒµÚÒ»¸ö½çÃæ³ÌÐò.Ö÷Òª¹¦ÄܾÍÊÇÊäÈëÁ½¸öÊý×Ö,¼ÆËãÕâÁ½¸öÊý×ֵĺÍ,ºÜ¼òµ¥µÄ¹¦ÄÜ,ÎÒÈ´»¨Á˺ܾÃ,¶ÔjavaÌ«²»ÊìϤÁË,Á¬µÃµ½textField1ÖÐÓû§ÊäÈëµÄÖµÔõô»ñµÃ,¶¼²»ÖªµÀ,ºóÀ´baidu²ÅÖªµÀ,
Óà textField1.getText()»ñµÃÊäÈëµÄÖµ;,
  ......
ΪʲôҪʹÓÃtomcat£¬jboosÕâÖÖ·þÎñÀ´ÔËÐÐÎÒÃǵĴúÂ룬Óкαػ¨Ôõô¶àÇ®ÂòIBm£¬BEAµÄ·þÎñÆ÷¡£²Ý£¨·ßÇàµÄÓïÆø£©£¬ÎÒÃÇÔÙÒ²²»¸ú±ðÈË×ß¡£
ÄѵÀÎÒÃÇ×Ô¼ºÐ´µÄ¶«Î÷¾Í²»¿É¿¿Âð£¿ÎÒÃÇ¿ª·¢ÎÒÃǵÄÏîÄ¿£¬ÐèÇóÎÒÃÇ×îÇå³þ£¬ÎÒÃÇÔõô×ö¸ÉÂﻹҪËûÃǹܣ¬SSHÊDZðÈËÌßÈ¥À´¡£
´Ó½ñÒÔºó£¬ÎÒ×Ô¼º¿ª·¢µÄjavaÆóÒµ³ÌÐò(tmd ÎÞ·¨¾ÍÊÇÇëÇó/ÏìӦģʽ ......
ÕâÊÇÒ»¸öwebËÑË÷µÄ»ù±¾³ÌÐò£¬´ÓÃüÁîÐÐÊäÈëËÑË÷Ìõ¼þ£¨ÆðʼµÄURL¡¢´¦ÀíurlµÄ×î´óÊý¡¢ÒªËÑË÷µÄ×Ö·û´®),
Ëü¾Í»áÖð¸ö¶ÔInternetÉϵÄURL½øÐÐʵʱËÑË÷,²éÕÒ²¢Êä³öÆ¥ÅäËÑË÷Ìõ¼þµÄÒ³Ãæ¡£ Õâ¸ö³ÌÐòµÄÔÐÍÀ´×Ô¡¶java±à³ÌÒÕÊõ¡·£¬
ΪÁ˸üºÃµÄ·ÖÎö£¬Õ¾³¤È¥µôÁËÆäÖеÄGUI²¿·Ö£¬²¢ÉÔ×÷ÐÞ¸ÄÒÔÊÊÓÃjdk1.5¡£ÒÔÕâ¸ö³ÌÐòΪ»ù´¡£¬¿ÉÒÔд³öÔÚ» ......
keytoolÉú³ÉÖ¤Êé
ÑéÖ¤ÊÇ·ñÒÑ´´½¨¹ýͬÃûµÄÖ¤Êé
keytool -list -v -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit
ɾ³ýÒÑ´´½¨µÄÖ¤Êé
keytool -delete -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit
´´½¨Ö¤Êé
1.·þÎñ ......