java´¦Àí Excel(POI°ü)
×î½üÔÚÔÛÃÇÕâ¸öÂÛ̳Àï×ÜÄÜ¿´¼û´ó¼ÒÌá³öÓÃjava´¦ÀíExcelµÄÎÊÌ⣬ÓÐʱ»¹Éæ¼°µ½Í¼ÐεÄÎÊÌ⣬
´ó¼Ò¿´ÁËÕâƪÎÄÕºó£¬ÎÒÏëÒ»¶¨»á½â¾ö²»ÉÙÈ˵ÄÎÊÌ⣡
¿´µ½ÍøÉϺܶàÎÄÕ¶¼Ò»Ö±¶¼ÊÇ˵POIµÄAPI²»ÄÜ´¦ÀíͼÐΣ¬Ò²¾ÍÊDz»ÄÜÍùExcelÀïÃæ¼ÓÈëͼÐΡ£
µ«ÊÂʵÉÏ£¬POI3.0³öÀ´Ö®ºó£¬Õâ¸öÎÊÌâÒѾ½â¾ö£¡ËùÒÔ˵£¬ÍùExcelÀïÃæ¼ÓÈëͼÐβ»±ØÒ»¶¨ÇóÖúÓÚJAVA EXCEL APIÁË¡£
×î½üÔÚһλ´ïÈ˵ÄÆô·¢Ï£¬ÖÕÓÚ½â¾öÁËÕâ¸öÎÊÌ⣬¾Í´Ë£¬Ð´ÏÂÕâЩ£¬Èç¹ûÓÐÈË¿´µ½µÄ»°£¬Ò²Ï£ÍûÄܶÔËûÓеã°ïÖú°É¡£
´úÂ룺
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet();
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
BufferedImage bufferImg = ImageIO.read(new File("D:\\fruit.PNG"));
ImageIO.write(bufferImg,"PNG",byteArrayOut);
HSSFClientAnchor anchor =
new HSSFClientAnchor(5,0,500,122,(short) 0, 5,(short)10,15);
HSSFPatriarch patri = sheet.createDrawingPatriarch();
patri.createPicture(anchor ,
wb.addPicture(byteArrayOut.toByteArray(),
HSSFWorkbook.PICTURE_TYPE_PNG));
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
wb.write(outStream);
ÉÏÃæ´úÂëÖ»ÊÇ´ó¸Å£¬µ«ÐèÒªÓõ½µÄÀ඼ÒѾÁгö¡£½ÓÏÂÀ´ÐèÒª×öµÄ¾ÍÊÇ°Ñ outStreamÊä³öµ½excelÎļþÖÐÈ¥ÁË¡£
¾ßÌåµÄÀàµÄdocument¿ÉÒÔÈ¥ÏÂÃæÍøÕ¾Éϲ鿴:
http://jakarta.apache.org/poi/apidocs/org/apache/poi/hssf/usermodel/HSSFWorkbook.html
Ïà¹ØÎĵµ£º
ͨ³££¬¶àÏß³ÌÖ®¼äÐèҪе÷¹¤×÷¡£ÀýÈ磬ä¯ÀÀÆ÷µÄÒ»¸öÏÔʾͼƬµÄÏß³ÌdisplayThreadÏëÒªÖ´ÐÐÏÔʾͼƬµÄÈÎÎñ£¬±ØÐëµÈ´ýÏÂÔØÏß³ÌdownloadThread½«¸ÃͼƬÏÂÔØÍê±Ï¡£Èç¹ûͼƬ»¹Ã»ÓÐÏÂÔØÍ꣬displayThread¿ÉÒÔÔÝÍ££¬µ±downloadThreadÍê³ÉÁËÈÎÎñºó£¬ÔÙ֪ͨdisplayThread“ͼƬ׼±¸Íê±Ï£¬¿ÉÒÔÏÔʾÁË”£¬Õâʱ£¬displayThread ......
¶îÍâJAR°ü£º
org.springframework.expression-3.0.1.RELEASE.jar
org.springframework.asm-3.0.1.RELEASE.jar
org.springframework.beans-3.0.1.RELEASE.jar
p:statementCacheSize="100"
<bean id="masterDataSource" class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close"
p:driverClass="com.m ......
ÔÚ·Ö²¼Ê½·þÎñ¿ò¼ÜÖУ¬Ò»¸ö×î»ù´¡µÄÎÊÌâ¾ÍÊÇÔ¶³Ì·þÎñÊÇÔõôͨѶµÄ£¬ÔÚJavaÁìÓòÖÐÓкܶà¿ÉʵÏÖÔ¶³ÌͨѶµÄ¼¼Êõ£¬ÀýÈ磺RMI¡¢MINA¡¢ESB¡¢Burlap¡¢Hessian¡¢SOAP¡¢EJBºÍJMSµÈ£¬ÕâЩÃû´ÊÖ®¼äµ½µ×ÊÇЩʲô¹ØϵÄØ£¬ËüÃDZ³ºóµ½µ×ÊÇ»ùÓÚʲôÔÀíʵÏÖµÄÄØ£¬Á˽âÕâЩÊÇʵÏÖ·Ö²¼Ê½·þÎñ¿ò¼ÜµÄ»ù´¡ÖªÊ¶£¬¶øÈç¹ûÔÚÐÔÄÜÉÏÓиߵÄÒªÇóµÄ»°£¬ÄÇÉ ......
Á˽âȱʡLocaleÊÇÓɲÙ×÷ϵͳ¾ö¶¨µÄ£¬LocaleÊÇÓÉÓïÑԺ͹ú¼Ò´úÂë×é³É
¹ú¼Ê»¯×ÊÔ´ÎļþÓÉbaseName+locale×é³É£¬È磺MessageBundle_en_US.properties£¨baseNameÊÇÈÎÒâºÏ·¨µÄÎļþÃû£©
native2asciiÃüÁîµÄλÖúÍÓ÷¨
λÖãºJAVA_HOME/bin
ʹÓÃnative2ascii.exe o.properties MessagesBundle_zh_CN.properties ÃüÁî¶ÔÕû¸öÎļþ ......