{"id":289,"date":"2009-11-26T09:57:37","date_gmt":"2009-11-26T01:57:37","guid":{"rendered":"http:\/\/amjet.dyndns.biz\/blog\/IT\/?p=289"},"modified":"2013-03-01T19:49:55","modified_gmt":"2013-03-01T11:49:55","slug":"poi-%e5%88%97%e5%8d%b0-excel-%e7%9a%84%e5%b0%8f%e6%8a%80%e5%b7%a7","status":"publish","type":"post","link":"https:\/\/blog.amjet.biz\/IT\/?p=289","title":{"rendered":"POI \u5217\u5370 Excel \u7684\u5c0f\u6280\u5de7"},"content":{"rendered":"<p><strong>1. \u5229\u7528 jdk 6 \u65b0\u7684 API java.awt.Desktop \u5217\u5370<\/strong><\/p>\n<p>\u4ee5 excel \u70ba\u4f8b\uff0c\u9019\u500b API \u6703\u555f\u52d5\u76ee\u524d\u7684\u5e73\u53f0\u5df2\u7d93\u767b\u8a18\u8655\u7406 xls \u6a94\u6848\u7684\u7a0b\u5f0f\u4f86\u5217\u5370\u6307\u5b9a\u7684\u6a94\u6848\uff0csample code \u5982\u4e0b\uff1a<\/p>\n<p>if ( Desktop.isDesktopSupported() ) {<br \/>\nDesktop desktop=Desktop.getDesktop();<br \/>\nif ( desktop.isSupported(Desktop.Action.PRINT) ) {<br \/>\ndesktop.print(excelFile);<br \/>\n}<br \/>\n} else {<br \/>\nSystem.out.println(&#8220;debug: desktop not supported!&#8221;);<br \/>\n}<\/p>\n<p><strong>2. \u5217\u5370 excel \u6a94\u6848\u5167\u6240\u6709\u7684\u5de5\u4f5c\u8868<\/strong><\/p>\n<p>\u5229\u7528\u4ee5\u4e0a\u65b9\u6cd5\u5217\u5370\u6642\uff0c\u901a\u5e38\u53ea\u6703\u5370\u51fa excel \u6a94\u7684\u7b2c\u4e00\u500b\u5de5\u4f5c\u8868\uff0c\u5982\u679c\u8981\u5370\u51fa\u6240\u6709\u5de5\u4f5c\u8868\u53ef\u4ee5\u5229\u7528org.apache.poi.hssf.usermodel.HSSFSheet \u7684 setSelected method\uff0c\u4f8b\u5982<\/p>\n<p>for(int i=1;i&lt;sheetCount;i++) {<\/p>\n<p>workbook.getSheetAt(i).setSelected(true);<\/p>\n<p>}<\/p>\n<p><strong>[ratings]<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u5229\u7528 jdk 6 \u65b0\u7684 API java.awt.Desktop \u5217\u5370 \u4ee5 excel \u70ba\u4f8b\uff0c\u9019\u500b API \u6703\u555f\u52d5\u76ee\u524d\u7684\u5e73\u53f0\u5df2\u7d93\u767b\u8a18\u8655\u7406 xls \u6a94\u6848\u7684\u7a0b\u5f0f\u4f86\u5217\u5370\u6307\u5b9a\u7684\u6a94\u6848\uff0csample code \u5982\u4e0b\uff1a if ( Desktop.isDesktopSupported() ) { Desktop desktop=Desktop.getDesktop(); if ( desktop.isSupported(Desktop.Action.PRINT) ) { desktop.print(excelFile); } } else { System.out.println(&#8220;debug: desktop not supported!&#8221;); } 2. \u5217\u5370 excel \u6a94\u6848\u5167\u6240\u6709\u7684\u5de5\u4f5c\u8868 \u5229\u7528\u4ee5\u4e0a\u65b9\u6cd5\u5217\u5370\u6642\uff0c\u901a\u5e38\u53ea\u6703\u5370\u51fa excel \u6a94\u7684\u7b2c\u4e00\u500b\u5de5\u4f5c\u8868\uff0c\u5982\u679c\u8981\u5370\u51fa\u6240\u6709\u5de5\u4f5c\u8868\u53ef\u4ee5\u5229\u7528org.apache.poi.hssf.usermodel.HSSFSheet \u7684 setSelected method\uff0c\u4f8b\u5982 for(int i=1;i&lt;sheetCount;i++) { workbook.getSheetAt(i).setSelected(true); } [ratings]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[133,28],"class_list":["post-289","post","type-post","status-publish","format-standard","hentry","category-java","tag-java","tag-poi"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"1. \u5229\u7528 jdk 6 \u65b0\u7684 API java.awt.Desktop \u5217\u5370 \u4ee5 excel \u70ba\u4f8b\uff0c\u9019\u500b API \u6703\u555f\u52d5\u76ee\u524d\u7684\u5e73\u53f0\u5df2\u7d93\u767b\u8a18\u8655\u7406 xls \u6a94\u6848\u7684\u7a0b\u5f0f\u4f86\u5217\u5370\u6307\u5b9a\u7684\u6a94\u6848\uff0csample code \u5982\u4e0b\uff1a if ( Desktop.isDesktopSupported() ) { Desktop desktop=Desktop.getDesktop(); if ( desktop.isSupported(Desktop.Action.PRINT) ) { desktop.print(excelFile); } } else { System.out.println(&quot;debug: desktop not supported!&quot;); } 2. \u5217\u5370 excel \u6a94\u6848\u5167\u6240\u6709\u7684\u5de5\u4f5c\u8868 \u5229\u7528\u4ee5\u4e0a\u65b9\u6cd5\u5217\u5370\u6642\uff0c\u901a\u5e38\u53ea\u6703\u5370\u51fa excel \u6a94\u7684\u7b2c\u4e00\u500b\u5de5\u4f5c\u8868\uff0c\u5982\u679c\u8981\u5370\u51fa\u6240\u6709\u5de5\u4f5c\u8868\u53ef\u4ee5\u5229\u7528org.apache.poi.hssf.usermodel.HSSFSheet \u7684 setSelected method\uff0c\u4f8b\u5982 for(int i=1;i\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"vincent\"\/>\n\t<meta name=\"keywords\" content=\"java,poi\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/blog.amjet.biz\/IT\/?p=289\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"AmJet IT Blog | for IT professionals\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"POI \u5217\u5370 Excel \u7684\u5c0f\u6280\u5de7 | AmJet IT Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"1. \u5229\u7528 jdk 6 \u65b0\u7684 API java.awt.Desktop \u5217\u5370 \u4ee5 excel \u70ba\u4f8b\uff0c\u9019\u500b API \u6703\u555f\u52d5\u76ee\u524d\u7684\u5e73\u53f0\u5df2\u7d93\u767b\u8a18\u8655\u7406 xls \u6a94\u6848\u7684\u7a0b\u5f0f\u4f86\u5217\u5370\u6307\u5b9a\u7684\u6a94\u6848\uff0csample code \u5982\u4e0b\uff1a if ( Desktop.isDesktopSupported() ) { Desktop desktop=Desktop.getDesktop(); if ( desktop.isSupported(Desktop.Action.PRINT) ) { desktop.print(excelFile); } } else { System.out.println(&quot;debug: desktop not supported!&quot;); } 2. \u5217\u5370 excel \u6a94\u6848\u5167\u6240\u6709\u7684\u5de5\u4f5c\u8868 \u5229\u7528\u4ee5\u4e0a\u65b9\u6cd5\u5217\u5370\u6642\uff0c\u901a\u5e38\u53ea\u6703\u5370\u51fa excel \u6a94\u7684\u7b2c\u4e00\u500b\u5de5\u4f5c\u8868\uff0c\u5982\u679c\u8981\u5370\u51fa\u6240\u6709\u5de5\u4f5c\u8868\u53ef\u4ee5\u5229\u7528org.apache.poi.hssf.usermodel.HSSFSheet \u7684 setSelected method\uff0c\u4f8b\u5982 for(int i=1;i\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/blog.amjet.biz\/IT\/?p=289\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2009-11-26T01:57:37+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2013-03-01T11:49:55+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"POI \u5217\u5370 Excel \u7684\u5c0f\u6280\u5de7 | AmJet IT Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"1. \u5229\u7528 jdk 6 \u65b0\u7684 API java.awt.Desktop \u5217\u5370 \u4ee5 excel \u70ba\u4f8b\uff0c\u9019\u500b API \u6703\u555f\u52d5\u76ee\u524d\u7684\u5e73\u53f0\u5df2\u7d93\u767b\u8a18\u8655\u7406 xls \u6a94\u6848\u7684\u7a0b\u5f0f\u4f86\u5217\u5370\u6307\u5b9a\u7684\u6a94\u6848\uff0csample code \u5982\u4e0b\uff1a if ( Desktop.isDesktopSupported() ) { Desktop desktop=Desktop.getDesktop(); if ( desktop.isSupported(Desktop.Action.PRINT) ) { desktop.print(excelFile); } } else { System.out.println(&quot;debug: desktop not supported!&quot;); } 2. \u5217\u5370 excel \u6a94\u6848\u5167\u6240\u6709\u7684\u5de5\u4f5c\u8868 \u5229\u7528\u4ee5\u4e0a\u65b9\u6cd5\u5217\u5370\u6642\uff0c\u901a\u5e38\u53ea\u6703\u5370\u51fa excel \u6a94\u7684\u7b2c\u4e00\u500b\u5de5\u4f5c\u8868\uff0c\u5982\u679c\u8981\u5370\u51fa\u6240\u6709\u5de5\u4f5c\u8868\u53ef\u4ee5\u5229\u7528org.apache.poi.hssf.usermodel.HSSFSheet \u7684 setSelected method\uff0c\u4f8b\u5982 for(int i=1;i\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?p=289#article\",\"name\":\"POI \\u5217\\u5370 Excel \\u7684\\u5c0f\\u6280\\u5de7 | AmJet IT Blog\",\"headline\":\"POI \\u5217\\u5370 Excel \\u7684\\u5c0f\\u6280\\u5de7\",\"author\":{\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?author=2#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/#organization\"},\"datePublished\":\"2009-11-26T09:57:37+08:00\",\"dateModified\":\"2013-03-01T19:49:55+08:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?p=289#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?p=289#webpage\"},\"articleSection\":\"Java, Java, poi\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?p=289#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?cat=5#listItem\",\"name\":\"Developer\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?cat=5#listItem\",\"position\":2,\"name\":\"Developer\",\"item\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?cat=5\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?cat=8#listItem\",\"name\":\"Java\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?cat=8#listItem\",\"position\":3,\"name\":\"Java\",\"item\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?cat=8\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?p=289#listItem\",\"name\":\"POI \\u5217\\u5370 Excel \\u7684\\u5c0f\\u6280\\u5de7\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?cat=5#listItem\",\"name\":\"Developer\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?p=289#listItem\",\"position\":4,\"name\":\"POI \\u5217\\u5370 Excel \\u7684\\u5c0f\\u6280\\u5de7\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?cat=8#listItem\",\"name\":\"Java\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/#organization\",\"name\":\"AmJet Digital\",\"description\":\"for IT professionals\",\"url\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?author=2#author\",\"url\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?author=2\",\"name\":\"vincent\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?p=289#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8c6bcd6e8e7e1c9bce74184354da4a5c294d71657c7abc161841c4799d1b1a46?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"vincent\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?p=289#webpage\",\"url\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?p=289\",\"name\":\"POI \\u5217\\u5370 Excel \\u7684\\u5c0f\\u6280\\u5de7 | AmJet IT Blog\",\"description\":\"1. \\u5229\\u7528 jdk 6 \\u65b0\\u7684 API java.awt.Desktop \\u5217\\u5370 \\u4ee5 excel \\u70ba\\u4f8b\\uff0c\\u9019\\u500b API \\u6703\\u555f\\u52d5\\u76ee\\u524d\\u7684\\u5e73\\u53f0\\u5df2\\u7d93\\u767b\\u8a18\\u8655\\u7406 xls \\u6a94\\u6848\\u7684\\u7a0b\\u5f0f\\u4f86\\u5217\\u5370\\u6307\\u5b9a\\u7684\\u6a94\\u6848\\uff0csample code \\u5982\\u4e0b\\uff1a if ( Desktop.isDesktopSupported() ) { Desktop desktop=Desktop.getDesktop(); if ( desktop.isSupported(Desktop.Action.PRINT) ) { desktop.print(excelFile); } } else { System.out.println(\\\"debug: desktop not supported!\\\"); } 2. \\u5217\\u5370 excel \\u6a94\\u6848\\u5167\\u6240\\u6709\\u7684\\u5de5\\u4f5c\\u8868 \\u5229\\u7528\\u4ee5\\u4e0a\\u65b9\\u6cd5\\u5217\\u5370\\u6642\\uff0c\\u901a\\u5e38\\u53ea\\u6703\\u5370\\u51fa excel \\u6a94\\u7684\\u7b2c\\u4e00\\u500b\\u5de5\\u4f5c\\u8868\\uff0c\\u5982\\u679c\\u8981\\u5370\\u51fa\\u6240\\u6709\\u5de5\\u4f5c\\u8868\\u53ef\\u4ee5\\u5229\\u7528org.apache.poi.hssf.usermodel.HSSFSheet \\u7684 setSelected method\\uff0c\\u4f8b\\u5982 for(int i=1;i\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?p=289#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?author=2#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/?author=2#author\"},\"datePublished\":\"2009-11-26T09:57:37+08:00\",\"dateModified\":\"2013-03-01T19:49:55+08:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/#website\",\"url\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/\",\"name\":\"AmJet IT Blog\",\"description\":\"for IT professionals\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/blog.amjet.biz\\\/IT\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"POI \u5217\u5370 Excel \u7684\u5c0f\u6280\u5de7 | AmJet IT Blog","description":"1. \u5229\u7528 jdk 6 \u65b0\u7684 API java.awt.Desktop \u5217\u5370 \u4ee5 excel \u70ba\u4f8b\uff0c\u9019\u500b API \u6703\u555f\u52d5\u76ee\u524d\u7684\u5e73\u53f0\u5df2\u7d93\u767b\u8a18\u8655\u7406 xls \u6a94\u6848\u7684\u7a0b\u5f0f\u4f86\u5217\u5370\u6307\u5b9a\u7684\u6a94\u6848\uff0csample code \u5982\u4e0b\uff1a if ( Desktop.isDesktopSupported() ) { Desktop desktop=Desktop.getDesktop(); if ( desktop.isSupported(Desktop.Action.PRINT) ) { desktop.print(excelFile); } } else { System.out.println(\"debug: desktop not supported!\"); } 2. \u5217\u5370 excel \u6a94\u6848\u5167\u6240\u6709\u7684\u5de5\u4f5c\u8868 \u5229\u7528\u4ee5\u4e0a\u65b9\u6cd5\u5217\u5370\u6642\uff0c\u901a\u5e38\u53ea\u6703\u5370\u51fa excel \u6a94\u7684\u7b2c\u4e00\u500b\u5de5\u4f5c\u8868\uff0c\u5982\u679c\u8981\u5370\u51fa\u6240\u6709\u5de5\u4f5c\u8868\u53ef\u4ee5\u5229\u7528org.apache.poi.hssf.usermodel.HSSFSheet \u7684 setSelected method\uff0c\u4f8b\u5982 for(int i=1;i","canonical_url":"https:\/\/blog.amjet.biz\/IT\/?p=289","robots":"max-image-preview:large","keywords":"java,poi","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.amjet.biz\/IT\/?p=289#article","name":"POI \u5217\u5370 Excel \u7684\u5c0f\u6280\u5de7 | AmJet IT Blog","headline":"POI \u5217\u5370 Excel \u7684\u5c0f\u6280\u5de7","author":{"@id":"https:\/\/blog.amjet.biz\/IT\/?author=2#author"},"publisher":{"@id":"https:\/\/blog.amjet.biz\/IT\/#organization"},"datePublished":"2009-11-26T09:57:37+08:00","dateModified":"2013-03-01T19:49:55+08:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/blog.amjet.biz\/IT\/?p=289#webpage"},"isPartOf":{"@id":"https:\/\/blog.amjet.biz\/IT\/?p=289#webpage"},"articleSection":"Java, Java, poi"},{"@type":"BreadcrumbList","@id":"https:\/\/blog.amjet.biz\/IT\/?p=289#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/blog.amjet.biz\/IT#listItem","position":1,"name":"Home","item":"https:\/\/blog.amjet.biz\/IT","nextItem":{"@type":"ListItem","@id":"https:\/\/blog.amjet.biz\/IT\/?cat=5#listItem","name":"Developer"}},{"@type":"ListItem","@id":"https:\/\/blog.amjet.biz\/IT\/?cat=5#listItem","position":2,"name":"Developer","item":"https:\/\/blog.amjet.biz\/IT\/?cat=5","nextItem":{"@type":"ListItem","@id":"https:\/\/blog.amjet.biz\/IT\/?cat=8#listItem","name":"Java"},"previousItem":{"@type":"ListItem","@id":"https:\/\/blog.amjet.biz\/IT#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/blog.amjet.biz\/IT\/?cat=8#listItem","position":3,"name":"Java","item":"https:\/\/blog.amjet.biz\/IT\/?cat=8","nextItem":{"@type":"ListItem","@id":"https:\/\/blog.amjet.biz\/IT\/?p=289#listItem","name":"POI \u5217\u5370 Excel \u7684\u5c0f\u6280\u5de7"},"previousItem":{"@type":"ListItem","@id":"https:\/\/blog.amjet.biz\/IT\/?cat=5#listItem","name":"Developer"}},{"@type":"ListItem","@id":"https:\/\/blog.amjet.biz\/IT\/?p=289#listItem","position":4,"name":"POI \u5217\u5370 Excel \u7684\u5c0f\u6280\u5de7","previousItem":{"@type":"ListItem","@id":"https:\/\/blog.amjet.biz\/IT\/?cat=8#listItem","name":"Java"}}]},{"@type":"Organization","@id":"https:\/\/blog.amjet.biz\/IT\/#organization","name":"AmJet Digital","description":"for IT professionals","url":"https:\/\/blog.amjet.biz\/IT\/"},{"@type":"Person","@id":"https:\/\/blog.amjet.biz\/IT\/?author=2#author","url":"https:\/\/blog.amjet.biz\/IT\/?author=2","name":"vincent","image":{"@type":"ImageObject","@id":"https:\/\/blog.amjet.biz\/IT\/?p=289#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/8c6bcd6e8e7e1c9bce74184354da4a5c294d71657c7abc161841c4799d1b1a46?s=96&d=mm&r=g","width":96,"height":96,"caption":"vincent"}},{"@type":"WebPage","@id":"https:\/\/blog.amjet.biz\/IT\/?p=289#webpage","url":"https:\/\/blog.amjet.biz\/IT\/?p=289","name":"POI \u5217\u5370 Excel \u7684\u5c0f\u6280\u5de7 | AmJet IT Blog","description":"1. \u5229\u7528 jdk 6 \u65b0\u7684 API java.awt.Desktop \u5217\u5370 \u4ee5 excel \u70ba\u4f8b\uff0c\u9019\u500b API \u6703\u555f\u52d5\u76ee\u524d\u7684\u5e73\u53f0\u5df2\u7d93\u767b\u8a18\u8655\u7406 xls \u6a94\u6848\u7684\u7a0b\u5f0f\u4f86\u5217\u5370\u6307\u5b9a\u7684\u6a94\u6848\uff0csample code \u5982\u4e0b\uff1a if ( Desktop.isDesktopSupported() ) { Desktop desktop=Desktop.getDesktop(); if ( desktop.isSupported(Desktop.Action.PRINT) ) { desktop.print(excelFile); } } else { System.out.println(\"debug: desktop not supported!\"); } 2. \u5217\u5370 excel \u6a94\u6848\u5167\u6240\u6709\u7684\u5de5\u4f5c\u8868 \u5229\u7528\u4ee5\u4e0a\u65b9\u6cd5\u5217\u5370\u6642\uff0c\u901a\u5e38\u53ea\u6703\u5370\u51fa excel \u6a94\u7684\u7b2c\u4e00\u500b\u5de5\u4f5c\u8868\uff0c\u5982\u679c\u8981\u5370\u51fa\u6240\u6709\u5de5\u4f5c\u8868\u53ef\u4ee5\u5229\u7528org.apache.poi.hssf.usermodel.HSSFSheet \u7684 setSelected method\uff0c\u4f8b\u5982 for(int i=1;i","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/blog.amjet.biz\/IT\/#website"},"breadcrumb":{"@id":"https:\/\/blog.amjet.biz\/IT\/?p=289#breadcrumblist"},"author":{"@id":"https:\/\/blog.amjet.biz\/IT\/?author=2#author"},"creator":{"@id":"https:\/\/blog.amjet.biz\/IT\/?author=2#author"},"datePublished":"2009-11-26T09:57:37+08:00","dateModified":"2013-03-01T19:49:55+08:00"},{"@type":"WebSite","@id":"https:\/\/blog.amjet.biz\/IT\/#website","url":"https:\/\/blog.amjet.biz\/IT\/","name":"AmJet IT Blog","description":"for IT professionals","inLanguage":"en-US","publisher":{"@id":"https:\/\/blog.amjet.biz\/IT\/#organization"}}]},"og:locale":"en_US","og:site_name":"AmJet IT Blog | for IT professionals","og:type":"article","og:title":"POI \u5217\u5370 Excel \u7684\u5c0f\u6280\u5de7 | AmJet IT Blog","og:description":"1. \u5229\u7528 jdk 6 \u65b0\u7684 API java.awt.Desktop \u5217\u5370 \u4ee5 excel \u70ba\u4f8b\uff0c\u9019\u500b API \u6703\u555f\u52d5\u76ee\u524d\u7684\u5e73\u53f0\u5df2\u7d93\u767b\u8a18\u8655\u7406 xls \u6a94\u6848\u7684\u7a0b\u5f0f\u4f86\u5217\u5370\u6307\u5b9a\u7684\u6a94\u6848\uff0csample code \u5982\u4e0b\uff1a if ( Desktop.isDesktopSupported() ) { Desktop desktop=Desktop.getDesktop(); if ( desktop.isSupported(Desktop.Action.PRINT) ) { desktop.print(excelFile); } } else { System.out.println(&quot;debug: desktop not supported!&quot;); } 2. \u5217\u5370 excel \u6a94\u6848\u5167\u6240\u6709\u7684\u5de5\u4f5c\u8868 \u5229\u7528\u4ee5\u4e0a\u65b9\u6cd5\u5217\u5370\u6642\uff0c\u901a\u5e38\u53ea\u6703\u5370\u51fa excel \u6a94\u7684\u7b2c\u4e00\u500b\u5de5\u4f5c\u8868\uff0c\u5982\u679c\u8981\u5370\u51fa\u6240\u6709\u5de5\u4f5c\u8868\u53ef\u4ee5\u5229\u7528org.apache.poi.hssf.usermodel.HSSFSheet \u7684 setSelected method\uff0c\u4f8b\u5982 for(int i=1;i","og:url":"https:\/\/blog.amjet.biz\/IT\/?p=289","article:published_time":"2009-11-26T01:57:37+00:00","article:modified_time":"2013-03-01T11:49:55+00:00","twitter:card":"summary","twitter:title":"POI \u5217\u5370 Excel \u7684\u5c0f\u6280\u5de7 | AmJet IT Blog","twitter:description":"1. \u5229\u7528 jdk 6 \u65b0\u7684 API java.awt.Desktop \u5217\u5370 \u4ee5 excel \u70ba\u4f8b\uff0c\u9019\u500b API \u6703\u555f\u52d5\u76ee\u524d\u7684\u5e73\u53f0\u5df2\u7d93\u767b\u8a18\u8655\u7406 xls \u6a94\u6848\u7684\u7a0b\u5f0f\u4f86\u5217\u5370\u6307\u5b9a\u7684\u6a94\u6848\uff0csample code \u5982\u4e0b\uff1a if ( Desktop.isDesktopSupported() ) { Desktop desktop=Desktop.getDesktop(); if ( desktop.isSupported(Desktop.Action.PRINT) ) { desktop.print(excelFile); } } else { System.out.println(&quot;debug: desktop not supported!&quot;); } 2. \u5217\u5370 excel \u6a94\u6848\u5167\u6240\u6709\u7684\u5de5\u4f5c\u8868 \u5229\u7528\u4ee5\u4e0a\u65b9\u6cd5\u5217\u5370\u6642\uff0c\u901a\u5e38\u53ea\u6703\u5370\u51fa excel \u6a94\u7684\u7b2c\u4e00\u500b\u5de5\u4f5c\u8868\uff0c\u5982\u679c\u8981\u5370\u51fa\u6240\u6709\u5de5\u4f5c\u8868\u53ef\u4ee5\u5229\u7528org.apache.poi.hssf.usermodel.HSSFSheet \u7684 setSelected method\uff0c\u4f8b\u5982 for(int i=1;i"},"aioseo_meta_data":{"post_id":"289","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-24 02:26:56","updated":"2025-06-05 09:08:26","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/blog.amjet.biz\/IT\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/blog.amjet.biz\/IT\/?cat=5\" title=\"Developer\">Developer<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/blog.amjet.biz\/IT\/?cat=8\" title=\"Java\">Java<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tPOI \u5217\u5370 Excel \u7684\u5c0f\u6280\u5de7\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/blog.amjet.biz\/IT"},{"label":"Developer","link":"https:\/\/blog.amjet.biz\/IT\/?cat=5"},{"label":"Java","link":"https:\/\/blog.amjet.biz\/IT\/?cat=8"},{"label":"POI \u5217\u5370 Excel \u7684\u5c0f\u6280\u5de7","link":"https:\/\/blog.amjet.biz\/IT\/?p=289"}],"_links":{"self":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=289"}],"version-history":[{"count":6,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/289\/revisions"}],"predecessor-version":[{"id":682,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/289\/revisions\/682"}],"wp:attachment":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}