Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java²Ù×÷Excel£ºbook±£»¤

    ExcelµÄbook±£»¤ÊǺܳ£Óõģ¬Ö÷ÒªÊDz»ÏëÈñðÈËÐÞ¸ÄExcelµÄʱºòÓá£ÕâÑùÄܹ»±ÜÃâ¶ñÒâËæ±ãÐÞ¸ÄÊý¾Ý£¬Ìá¸ßÊý¾ÝµÄ¿ÉÐжȡ£
    ÄÇôJAVAÀ´ÊµÏÖÉèÖÃbook±£»¤Ôõô×öÄØ£¿
    ²éÕÒÁ˼¸ÖÖ³£¼ûµÄJAVA²Ù×÷ExcelµÄһЩ°ü£¬´óÌå½á¹ûÈçÏ£º
    1. POI
        POIµÄHSSFWorkbookÀàÓÐwriteProtectWorkbook(password, username)¡£Õâ±ß¿ÉÒÔÉèÖÃÃÜÂëºÍÊÂË­±£»¤µÄ£¬µ«Õâ¸ö¹ËÃû˼Òå¾Íд±£»¤£¬ÊµÏÖºÍExcelµÄbook±£»¤ÓгöÈë¡£
        µ±È»£¬sheet±£»¤µÄ»°ÓÃHSSFSheetÀàµÄprotectSheet(password)·½·¨¾Í¿ÉÒÔÁË¡£
    2. JXL
         WorkbookÀàµÄsetProtected£¨boolean£©·½·¨¸Ð¾õÊÇÓÃÀ´×öbook±£»¤µÄ£¬µ«¿´ÁË˵Ã÷ÊÇÉèÖÃsheet±£»¤µÄ¡£Òò´ËÒ²ÊÇʵÏÖ²»ÁËbook±£»¤µÄЧ¹û¡£
   3. OpenXLS
        ×îºóºÃ²»ÈÝÒ×ÕÒµ½ÁËÕâ¸ö°ü¡£WorkBookµÄsetProtected(true)·½·¨ÉèÖúó¾ÍʵÏÖÁËbook±£»¤¡£´úÂëÈçÏ£º
        // read file
        WorkBook workbook = new WorkBookHandle(new FileInputStream(new File("d:/openxlsTest.xls")));
        // protect
        workbook.setProtected(true);   
        // write file
        workbook.writeBytes(new FileOutputStream(new File("d:/openxlsProtect.xls")));
book±£»¤ºóµÄЧ¹û£¬sheet²»ÄÜÔö¼Ó£¬É¾³ýµÈ


Ïà¹ØÎĵµ£º

JavaÄÚ´æÒç³öµÄÏêϸ½â¾ö·½°¸(ת)

  ±¾ÎĽéÉÜÁËJavaÄÚ´æÒç³öµÄÏêϸ½â¾ö·½°¸¡£±¾ÎÄ×ܽáÄÚ´æÒç³öÖ÷ÒªÓÐÁ½ÖÖÇé¿ö£¬¶øJVM¾­³£µ÷ÓÃÀ¬»ø»ØÊÕÆ÷½â¾öÄÚ´æ¶Ñ²»×ãµÄÎÊÌ⣬µ«ÊÇÓÐʱÈÔ»áÓÐÄÚ´æ²»×ãµÄ´íÎó¡£×÷Õß·ÖÎöÁËJVMÄÚ´æÇøÓò×é³É¼°JVMÉèÖÃÐéÄâÄÚ´æµÄ·½Ê½£¬´Ó¶ø¸ø³öÁËһϵÁнâ¾ö·½°¸¡£ Ò»¡¢ÄÚ´æÒç³öÀàÐÍ 1¡¢java.lang.OutOfMemoryError: PermGen space JVM¹ ......

Java 7µÄÖ÷Òª±ä»¯

Devoxx ´ó»á½áÊøÔÚ¼¸ÌìÇ°½áÊøÁË£¬Ò»Î»Óë»áÕ߶Դ˴δó»áµÄÖØÒªÄÚÈݽøÐÐÁË×ܽᣬËûÌáµ½Java 7µÄÖ÷Òª±ä»¯ÈçÏ£º
1.¶ÔcollectionsµÄÖ§³Ö
Java´úÂë
List<String> list = new ArrayList<String>();   
list.add(“item”);   
String item =&nbs ......

javaÓëc#ͨÐÅÊý¾Ýת»»ÎÊÌâ

//ÓÉÓÚJAVAÓïÑÔµÄÊý¾ÝÀàÐͶ¼ÊÇÓзûºÅÀàÐÍ£¬¶øC# C++Ò»°ãÊý¾ÝÀàÐͶ¼ÊÇ·ÖÓзûºÅºÍÎÞ·ûºÅ,
//Òò´ËÔÚͨÐŹý³ÌÖд«µÝµÄByte[]ÎÞ·¨Ö±½Óת»»³ÉC#ÐèÒªµÄÀàÐÍ£¬
//ÒÔÇ°µ¹ÊÇûעÒâÕâЩϸ½Ú£¬ÒòΪһ°ãÓÃÒ»ÖÖÓïÑÔ±à³Ì£¬
//´ó¶¼ÓÐÄÚÖõÄת»»·½·¨¡£¿çÓïÑÔ»·¾³µÄת»»¾ÍµÄ×Ô¼º¶¯ÊÖÏë°ì·¨ÁË¡£
1¡¢javaµÄByte[]ת»»³Éc#µÄInt32
private i ......

jxl.jar°ü¼ò½é/java²Ù×÷excel jxl.jarÏÂÔØ

 ÏÂÔصØÖ·:
http://www.andykhan.com/jexcelapi/ µ±Ç°µÄ×î¸ß°æ±¾ÊÇ2.6¡£
ÕæʵÏÂÔصØÖ·:
http://www.andykhan.com/jexcelapi/download.html
×÷ÕßµÄÍøÕ¾É϶ÔËüµÄÌØÕ÷ÓÐÈçÏÂÃèÊö£º 
¡ñ Ö§³ÖExcel 95-2000µÄËùÓа汾 
¡ñ Éú³ÉExcel 2000±ê×¼¸ñʽ 
¡ñ Ö§³Ö×ÖÌå¡¢Êý×Ö ......

JavaϵĿò¼Ü±à³Ì(4)

 



1.ÒòΪÁ½ÕßµÄÓÃ;²»Í¬£¬ËùÒÔAnnotationÓëXMLÓ¦¸Ã²¢´æ
¡¡Anootation vs XML µ½ÁËÏÖÔÚ£¬ÔÚSpringºÍEJB3¸÷Õ¼Ò»±ßµÄ³ÖÐøÑÝʾÏ£¬¸÷×ÔµÄÓÃ;ÒÑÇåÎú¡£
   ËäÈ»Á½ÕßÖ®¼äÍêÈ«¿ÉÒÔÏ໥Ìæ´ú£¬Ã»Óоø¶Ô²»ÄÜ×öµÄÊÂÇ飬µ«È´´æÔںò»ºÃµÄÎÊÌ⣬Á½ÕßµÄÓÃ;²»Í¬£¬Ó¦¸Ã²¢Óãº
   "size=10£¬ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ