锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久亚洲精品AB无码播放,亚洲三级电影网站,亚洲无人区一区二区三区http://www.tkk7.com/Vincent-chenxj/category/36203.htmlzh-cnSat, 29 Nov 2008 05:12:53 GMTSat, 29 Nov 2008 05:12:53 GMT60鎿嶄綔word鐨勮В鍐蟲柟妗?/title><link>http://www.tkk7.com/Vincent-chenxj/articles/243382.html</link><dc:creator>Vincent-chen</dc:creator><author>Vincent-chen</author><pubDate>Sat, 29 Nov 2008 02:04:00 GMT</pubDate><guid>http://www.tkk7.com/Vincent-chenxj/articles/243382.html</guid><wfw:comment>http://www.tkk7.com/Vincent-chenxj/comments/243382.html</wfw:comment><comments>http://www.tkk7.com/Vincent-chenxj/articles/243382.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/Vincent-chenxj/comments/commentRss/243382.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/Vincent-chenxj/services/trackbacks/243382.html</trackback:ping><description><![CDATA[     鎽樿: /** *//**            *   緄︽枡緄辮▓Excel銉曘偂銈ゃ儷鏇搞亸            *  &nb...  <a href='http://www.tkk7.com/Vincent-chenxj/articles/243382.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/Vincent-chenxj/aggbug/243382.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/Vincent-chenxj/" target="_blank">Vincent-chen</a> 2008-11-29 10:04 <a href="http://www.tkk7.com/Vincent-chenxj/articles/243382.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>POI 灝嗘暟鎹鍑哄埌Word鐨勫疄渚?/title><link>http://www.tkk7.com/Vincent-chenxj/articles/243381.html</link><dc:creator>Vincent-chen</dc:creator><author>Vincent-chen</author><pubDate>Sat, 29 Nov 2008 01:55:00 GMT</pubDate><guid>http://www.tkk7.com/Vincent-chenxj/articles/243381.html</guid><wfw:comment>http://www.tkk7.com/Vincent-chenxj/comments/243381.html</wfw:comment><comments>http://www.tkk7.com/Vincent-chenxj/articles/243381.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/Vincent-chenxj/comments/commentRss/243381.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/Vincent-chenxj/services/trackbacks/243381.html</trackback:ping><description><![CDATA[<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #0000ff">import</span><span style="color: #000000"> java.io.</span><span style="color: #000000">*</span><span style="color: #000000">; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.util.</span><span style="color: #000000">*</span><span style="color: #000000">; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.poifs.filesystem.</span><span style="color: #000000">*</span><span style="color: #000000">; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.util.LittleEndian; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img id="Codehighlighter1_148_851_Open_Image" onclick="this.style.display='none'; Codehighlighter1_148_851_Open_Text.style.display='none'; Codehighlighter1_148_851_Closed_Image.style.display='inline'; Codehighlighter1_148_851_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_148_851_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_148_851_Closed_Text.style.display='none'; Codehighlighter1_148_851_Open_Image.style.display='inline'; Codehighlighter1_148_851_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> WordTest </span><span id="Codehighlighter1_148_851_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_148_851_Open_Text"><span style="color: #000000">{ <br /> <img id="Codehighlighter1_169_172_Open_Image" onclick="this.style.display='none'; Codehighlighter1_169_172_Open_Text.style.display='none'; Codehighlighter1_169_172_Closed_Image.style.display='inline'; Codehighlighter1_169_172_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_169_172_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_169_172_Closed_Text.style.display='none'; Codehighlighter1_169_172_Open_Image.style.display='inline'; Codehighlighter1_169_172_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> WordTest() </span><span id="Codehighlighter1_169_172_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_169_172_Open_Text"><span style="color: #000000">{ <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"> <br /> <img id="Codehighlighter1_240_752_Open_Image" onclick="this.style.display='none'; Codehighlighter1_240_752_Open_Text.style.display='none'; Codehighlighter1_240_752_Closed_Image.style.display='inline'; Codehighlighter1_240_752_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_240_752_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_240_752_Closed_Text.style.display='none'; Codehighlighter1_240_752_Open_Image.style.display='inline'; Codehighlighter1_240_752_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">boolean</span><span style="color: #000000"> writeWordFile(String path, String content) </span><span id="Codehighlighter1_240_752_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_240_752_Open_Text"><span style="color: #000000">{ <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">boolean</span><span style="color: #000000"> w </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">false</span><span style="color: #000000">; <br /> <img id="Codehighlighter1_267_689_Open_Image" onclick="this.style.display='none'; Codehighlighter1_267_689_Open_Text.style.display='none'; Codehighlighter1_267_689_Closed_Image.style.display='inline'; Codehighlighter1_267_689_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_267_689_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_267_689_Closed_Text.style.display='none'; Codehighlighter1_267_689_Open_Image.style.display='inline'; Codehighlighter1_267_689_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">try</span><span style="color: #000000"> </span><span id="Codehighlighter1_267_689_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_267_689_Open_Text"><span style="color: #000000">{ <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #008000">//</span><span style="color: #008000"> byte b[] = content.getBytes("ISO-8859-1"); </span><span style="color: #008000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">byte</span><span style="color: #000000"> b[] </span><span style="color: #000000">=</span><span style="color: #000000"> content.getBytes(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />ByteArrayInputStream bais </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ByteArrayInputStream(b); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />POIFSFileSystem fs </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> POIFSFileSystem(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />DirectoryEntry directory </span><span style="color: #000000">=</span><span style="color: #000000"> fs.getRoot(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />DocumentEntry de </span><span style="color: #000000">=</span><span style="color: #000000"> directory.createDocument(</span><span style="color: #000000">"</span><span style="color: #000000">WordDocument</span><span style="color: #000000">"</span><span style="color: #000000">, bais); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />FileOutputStream ostream </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> FileOutputStream(path); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />fs.writeFilesystem(ostream); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />bais.close(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />ostream.close(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img id="Codehighlighter1_713_738_Open_Image" onclick="this.style.display='none'; Codehighlighter1_713_738_Open_Text.style.display='none'; Codehighlighter1_713_738_Closed_Image.style.display='inline'; Codehighlighter1_713_738_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_713_738_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_713_738_Closed_Text.style.display='none'; Codehighlighter1_713_738_Open_Image.style.display='inline'; Codehighlighter1_713_738_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />}</span></span><span style="color: #000000"> </span><span style="color: #0000ff">catch</span><span style="color: #000000"> (IOException e) </span><span id="Codehighlighter1_713_738_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_713_738_Open_Text"><span style="color: #000000">{ <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />e.printStackTrace(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">return</span><span style="color: #000000"> w; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"> <br /> <img id="Codehighlighter1_793_848_Open_Image" onclick="this.style.display='none'; Codehighlighter1_793_848_Open_Text.style.display='none'; Codehighlighter1_793_848_Closed_Image.style.display='inline'; Codehighlighter1_793_848_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_793_848_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_793_848_Closed_Text.style.display='none'; Codehighlighter1_793_848_Open_Image.style.display='inline'; Codehighlighter1_793_848_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args)</span><span id="Codehighlighter1_793_848_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_793_848_Open_Text"><span style="color: #000000">{ <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">boolean</span><span style="color: #000000"> b </span><span style="color: #000000">=</span><span style="color: #000000"> writeWordFile(</span><span style="color: #000000">"</span><span style="color: #000000">E://test.doc</span><span style="color: #000000">"</span><span style="color: #000000">,</span><span style="color: #000000">"</span><span style="color: #000000">hello</span><span style="color: #000000">"</span><span style="color: #000000">); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"> <br /> <img id="Codehighlighter1_854_5064_Open_Image" onclick="this.style.display='none'; Codehighlighter1_854_5064_Open_Text.style.display='none'; Codehighlighter1_854_5064_Closed_Image.style.display='inline'; Codehighlighter1_854_5064_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_854_5064_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_854_5064_Closed_Text.style.display='none'; Codehighlighter1_854_5064_Open_Image.style.display='inline'; Codehighlighter1_854_5064_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span id="Codehighlighter1_854_5064_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_854_5064_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />public String extractText(InputStream in) throws IOException { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />ArrayList text = new ArrayList(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />POIFSFileSystem fsys = new POIFSFileSystem(in); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />DocumentEntry headerProps = (DocumentEntry) fsys.getRoot().getEntry("WordDocument"); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />DocumentInputStream din = fsys.createDocumentInputStream("WordDocument"); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />byte[] header = new byte[headerProps.getSize()]; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />din.read(header); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />din.close(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />// Prende le informazioni dall'header del documento <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />int info = LittleEndian.getShort(header, 0xa); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />boolean useTable1 = (info & 0x200) != 0; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />//boolean useTable1 = true; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />// Prende informazioni dalla piece table <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />int complexOffset = LittleEndian.getInt(header, 0x1a2); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />//int complexOffset = LittleEndian.getInt(header); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />String tableName = null; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />if (useTable1) { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />tableName = "1Table"; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} else { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />tableName = "0Table"; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />DocumentEntry table = (DocumentEntry) fsys.getRoot().getEntry(tableName); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />byte[] tableStream = new byte[table.getSize()]; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />din = fsys.createDocumentInputStream(tableName); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />din.read(tableStream); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />din.close(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />din = null; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />fsys = null; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />table = null; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />headerProps = null; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />int multiple = findText(tableStream, complexOffset, text); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />StringBuffer sb = new StringBuffer(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />int size = text.size(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />tableStream = null; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />for (int x = 0; x < size; x++) { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />WordTextPiece nextPiece = (WordTextPiece) text.get(x); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />int start = nextPiece.getStart(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />int length = nextPiece.getLength(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />boolean unicode = nextPiece.usesUnicode(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />String toStr = null; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />if (unicode) { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />toStr = new String(header, start, length * multiple, "UTF-16LE"); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} else { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />toStr = new String(header, start, length, "ISO-8859-1"); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />sb.append(toStr).append(" "); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />return sb.toString(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />private static int findText(byte[] tableStream, int complexOffset, ArrayList text) <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />throws IOException { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />//actual text <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />int pos = complexOffset; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />int multiple = 2; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />//skips through the prms before we reach the piece table. These contain data <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />//for actual fast saved files <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />while (tableStream[pos] == 1) { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />pos++; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />int skip = LittleEndian.getShort(tableStream, pos); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />pos += 2 + skip; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />if (tableStream[pos] != 2) { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />throw new IOException("corrupted Word file"); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} else { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />//parse out the text pieces <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />int pieceTableSize = LittleEndian.getInt(tableStream, ++pos); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />pos += 4; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />int pieces = (pieceTableSize - 4) / 12; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />for (int x = 0; x < pieces; x++) { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />int filePos = <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />LittleEndian.getInt(tableStream, pos + ((pieces + 1) * 4) + (x *<img src="http://www.tkk7.com/images/forum/smiles/icon_cool.gif"/> + 2); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />boolean unicode = false; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />if ((filePos & 0x40000000) == 0) { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />unicode = true; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} else { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />unicode = false; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />multiple = 1; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />filePos &= ~(0x40000000); //gives me FC in doc stream <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />filePos /= 2; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />int totLength = <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />LittleEndian.getInt(tableStream, pos + (x + 1) * 4) <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />- LittleEndian.getInt(tableStream, pos + (x * 4)); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />WordTextPiece piece = new WordTextPiece(filePos, totLength, unicode); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />text.add(piece); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />return multiple; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />public static void main(String[] args){ <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />WordTest w = new WordTest(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />POIFSFileSystem ps = new POIFSFileSystem(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />try{ <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />File file = new File("C:\\test.doc"); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />InputStream in = new FileInputStream(file); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />String s = w.extractText(in); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />System.out.println(s); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />}catch(Exception e){ <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />e.printStackTrace(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />public boolean writeWordFile(String path, String content) { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />boolean w = false; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />try { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />// byte b[] = content.getBytes("ISO-8859-1"); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />byte b[] = content.getBytes(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />ByteArrayInputStream bais = new ByteArrayInputStream(b); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />POIFSFileSystem fs = new POIFSFileSystem(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />DirectoryEntry directory = fs.getRoot(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />DocumentEntry de = directory.createDocument("WordDocument", bais); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />FileOutputStream ostream = new FileOutputStream(path); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />fs.writeFilesystem(ostream); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />bais.close(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />ostream.close(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} catch (IOException e) { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />e.printStackTrace(); <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />return w; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />class WordTextPiece { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />private int _fcStart; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />private boolean _usesUnicode; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />private int _length; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />public WordTextPiece(int start, int length, boolean unicode) { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />_usesUnicode = unicode; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />_length = length; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />_fcStart = start; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />public boolean usesUnicode() { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />return _usesUnicode; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />public int getStart() { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />return _fcStart; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />public int getLength() { <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />return _length; <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />} <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" /></span><span style="color: #008000">*/</span></span><span style="color: #000000"> </span></div> <img src ="http://www.tkk7.com/Vincent-chenxj/aggbug/243381.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/Vincent-chenxj/" target="_blank">Vincent-chen</a> 2008-11-29 09:55 <a href="http://www.tkk7.com/Vincent-chenxj/articles/243381.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浣跨敤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>

]]>
涓姝ヤ竴姝ヤ嬌鐢≒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><link>http://www.tkk7.com/Vincent-chenxj/articles/242499.html</link><dc:creator>Vincent-chen</dc:creator><author>Vincent-chen</author><pubDate>Tue, 25 Nov 2008 04:01:00 GMT</pubDate><guid>http://www.tkk7.com/Vincent-chenxj/articles/242499.html</guid><wfw:comment>http://www.tkk7.com/Vincent-chenxj/comments/242499.html</wfw:comment><comments>http://www.tkk7.com/Vincent-chenxj/articles/242499.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/Vincent-chenxj/comments/commentRss/242499.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/Vincent-chenxj/services/trackbacks/242499.html</trackback:ping><description><![CDATA[     鎽樿: 璇誨彇鍜岄噸鍐?Workbooks       1POIFSFileSystem fs      =  2  3            ...  <a href='http://www.tkk7.com/Vincent-chenxj/articles/242499.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/Vincent-chenxj/aggbug/242499.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/Vincent-chenxj/" target="_blank">Vincent-chen</a> 2008-11-25 12:01 <a href="http://www.tkk7.com/Vincent-chenxj/articles/242499.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浣跨敤POI鐢熸垚Excel鏂囨。騫惰緗墦鍗版牱寮?/title><link>http://www.tkk7.com/Vincent-chenxj/articles/242491.html</link><dc:creator>Vincent-chen</dc:creator><author>Vincent-chen</author><pubDate>Tue, 25 Nov 2008 03:47:00 GMT</pubDate><guid>http://www.tkk7.com/Vincent-chenxj/articles/242491.html</guid><wfw:comment>http://www.tkk7.com/Vincent-chenxj/comments/242491.html</wfw:comment><comments>http://www.tkk7.com/Vincent-chenxj/articles/242491.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/Vincent-chenxj/comments/commentRss/242491.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/Vincent-chenxj/services/trackbacks/242491.html</trackback:ping><description><![CDATA[<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080"> 1</span><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #0000ff">package</span><span style="color: #000000"> test;<br /> </span><span style="color: #008080"> 2</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> </span><span style="color: #008080"> 3</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.io.FileOutputStream;<br /> </span><span style="color: #008080"> 4</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.io.IOException;<br /> </span><span style="color: #008080"> 5</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> </span><span style="color: #008080"> 6</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.hssf.usermodel.HSSFCell;<br /> </span><span style="color: #008080"> 7</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.hssf.usermodel.HSSFCellStyle;<br /> </span><span style="color: #008080"> 8</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.hssf.usermodel.HSSFFont;<br /> </span><span style="color: #008080"> 9</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.hssf.usermodel.HSSFPrintSetup;<br /> </span><span style="color: #008080">10</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.hssf.usermodel.HSSFRichTextString;<br /> </span><span style="color: #008080">11</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.hssf.usermodel.HSSFRow;<br /> </span><span style="color: #008080">12</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.hssf.usermodel.HSSFSheet;<br /> </span><span style="color: #008080">13</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.hssf.usermodel.HSSFWorkbook;<br /> </span><span style="color: #008080">14</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> </span><span style="color: #008080">15</span><span style="color: #000000"><img id="Codehighlighter1_502_2238_Open_Image" onclick="this.style.display='none'; Codehighlighter1_502_2238_Open_Text.style.display='none'; Codehighlighter1_502_2238_Closed_Image.style.display='inline'; Codehighlighter1_502_2238_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_502_2238_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_502_2238_Closed_Text.style.display='none'; Codehighlighter1_502_2238_Open_Image.style.display='inline'; Codehighlighter1_502_2238_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> ExcelTest </span><span id="Codehighlighter1_502_2238_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_502_2238_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080">16</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> </span><span style="color: #008080">17</span><span style="color: #000000"><img id="Codehighlighter1_567_2236_Open_Image" onclick="this.style.display='none'; Codehighlighter1_567_2236_Open_Text.style.display='none'; Codehighlighter1_567_2236_Closed_Image.style.display='inline'; Codehighlighter1_567_2236_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_567_2236_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_567_2236_Closed_Text.style.display='none'; Codehighlighter1_567_2236_Open_Image.style.display='inline'; Codehighlighter1_567_2236_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args) </span><span style="color: #0000ff">throws</span><span style="color: #000000"> IOException </span><span id="Codehighlighter1_567_2236_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_567_2236_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080">18</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        <br /> </span><span style="color: #008080">19</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         </span><span style="color: #008000">//</span><span style="color: #008000"> create a new file  </span><span style="color: #008000"><br /> </span><span style="color: #008080">20</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">         FileOutputStream out </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> FileOutputStream(</span><span style="color: #000000">"</span><span style="color: #000000">D:/workbook.xls</span><span style="color: #000000">"</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">21</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         </span><span style="color: #008000">//</span><span style="color: #008000"> create a new workbook  </span><span style="color: #008000"><br /> </span><span style="color: #008080">22</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">         HSSFWorkbook wb </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> HSSFWorkbook();  <br /> </span><span style="color: #008080">23</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         </span><span style="color: #008000">//</span><span style="color: #008000"> create a new sheet  </span><span style="color: #008000"><br /> </span><span style="color: #008080">24</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">         HSSFSheet sheet </span><span style="color: #000000">=</span><span style="color: #000000"> wb.createSheet();  <br /> </span><span style="color: #008080">25</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />           <br /> </span><span style="color: #008080">26</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         </span><span style="color: #008000">//</span><span style="color: #008000">2.model  </span><span style="color: #008000"><br /> </span><span style="color: #008080">27</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">         HSSFRow row </span><span style="color: #000000">=</span><span style="color: #000000"> sheet.createRow(</span><span style="color: #000000">2</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">28</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         row.setHeightInPoints(</span><span style="color: #000000">20</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">29</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         HSSFCell cell </span><span style="color: #000000">=</span><span style="color: #000000"> row.createCell(</span><span style="color: #000000">2</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">30</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         HSSFFont cnFont </span><span style="color: #000000">=</span><span style="color: #000000"> wb.createFont();  <br /> </span><span style="color: #008080">31</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         cnFont.setFontHeightInPoints((</span><span style="color: #0000ff">short</span><span style="color: #000000">) </span><span style="color: #000000">10</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">32</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         </span><span style="color: #008000">//</span><span style="color: #008000">font.setFontName("姹変華鎶ュ畫綆");  </span><span style="color: #008000"><br /> </span><span style="color: #008080">33</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">         cnFont.setFontName(</span><span style="color: #000000">"</span><span style="color: #000000">闅朵功</span><span style="color: #000000">"</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">34</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         HSSFCellStyle cnStyle </span><span style="color: #000000">=</span><span style="color: #000000"> wb.createCellStyle();  <br /> </span><span style="color: #008080">35</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         cnStyle.setFont(cnFont);  <br /> </span><span style="color: #008080">36</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         cell.setCellStyle(cnStyle);  <br /> </span><span style="color: #008080">37</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         HSSFRichTextString richText </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> HSSFRichTextString(</span><span style="color: #000000">"</span><span style="color: #000000">涓枃瀛椾綋嫻嬭瘯</span><span style="color: #000000">"</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">38</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         cell.setCellValue(richText);  <br /> </span><span style="color: #008080">39</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         HSSFCell enCell </span><span style="color: #000000">=</span><span style="color: #000000"> row.createCell(</span><span style="color: #000000">3</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">40</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         HSSFFont enFont </span><span style="color: #000000">=</span><span style="color: #000000"> wb.createFont();  <br /> </span><span style="color: #008080">41</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         enFont.setFontHeightInPoints((</span><span style="color: #0000ff">short</span><span style="color: #000000">) </span><span style="color: #000000">10</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">42</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         enFont.setFontName(</span><span style="color: #000000">"</span><span style="color: #000000">Arial Black</span><span style="color: #000000">"</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">43</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         HSSFCellStyle enStyle </span><span style="color: #000000">=</span><span style="color: #000000"> wb.createCellStyle();  <br /> </span><span style="color: #008080">44</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         enStyle.setFont(enFont);  <br /> </span><span style="color: #008080">45</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         enCell.setCellStyle(enStyle);  <br /> </span><span style="color: #008080">46</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         enCell.setCellValue(</span><span style="color: #0000ff">new</span><span style="color: #000000"> HSSFRichTextString(</span><span style="color: #000000">"</span><span style="color: #000000">English font test</span><span style="color: #000000">"</span><span style="color: #000000">));  <br /> </span><span style="color: #008080">47</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         sheet.setColumnWidth(</span><span style="color: #000000">2</span><span style="color: #000000">, </span><span style="color: #000000">4000</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">48</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         sheet.setColumnWidth(</span><span style="color: #000000">3</span><span style="color: #000000">, </span><span style="color: #000000">4000</span><span style="color: #000000">);<br /> </span><span style="color: #008080">49</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         <br /> </span><span style="color: #008080">50</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         </span><span style="color: #008000">//</span><span style="color: #008000">3.output  </span><span style="color: #008000"><br /> </span><span style="color: #008080">51</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">         sheet.setDisplayGridlines(</span><span style="color: #0000ff">false</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">52</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         sheet.setPrintGridlines(</span><span style="color: #0000ff">false</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">53</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         HSSFPrintSetup printSetup </span><span style="color: #000000">=</span><span style="color: #000000"> sheet.getPrintSetup();  <br /> </span><span style="color: #008080">54</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         </span><span style="color: #008000">//</span><span style="color: #008000">A4綰?/span><span style="color: #008000"><br /> </span><span style="color: #008080">55</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">         printSetup.setPaperSize(HSSFPrintSetup.A4_PAPERSIZE);  <br /> </span><span style="color: #008080">56</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         wb.write(out);  <br /> </span><span style="color: #008080">57</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         out.close(); <br /> </span><span style="color: #008080">58</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">59</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">60</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <img src ="http://www.tkk7.com/Vincent-chenxj/aggbug/242491.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/Vincent-chenxj/" target="_blank">Vincent-chen</a> 2008-11-25 11:47 <a href="http://www.tkk7.com/Vincent-chenxj/articles/242491.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浣跨敤POI鍚慐xcel閲屾彃鍏ュ浘鐗?/title><link>http://www.tkk7.com/Vincent-chenxj/articles/242488.html</link><dc:creator>Vincent-chen</dc:creator><author>Vincent-chen</author><pubDate>Tue, 25 Nov 2008 03:40:00 GMT</pubDate><guid>http://www.tkk7.com/Vincent-chenxj/articles/242488.html</guid><wfw:comment>http://www.tkk7.com/Vincent-chenxj/comments/242488.html</wfw:comment><comments>http://www.tkk7.com/Vincent-chenxj/articles/242488.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/Vincent-chenxj/comments/commentRss/242488.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/Vincent-chenxj/services/trackbacks/242488.html</trackback:ping><description><![CDATA[<p> </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080"> 1</span><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #0000ff">package</span><span style="color: #000000"> test; <br /> </span><span style="color: #008080"> 2</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> </span><span style="color: #008080"> 3</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.io.ByteArrayOutputStream; <br /> </span><span style="color: #008080"> 4</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.io.File; <br /> </span><span style="color: #008080"> 5</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.io.FileInputStream; <br /> </span><span style="color: #008080"> 6</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.io.FileOutputStream; <br /> </span><span style="color: #008080"> 7</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.io.IOException; <br /> </span><span style="color: #008080"> 8</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> </span><span style="color: #008080"> 9</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.hssf.usermodel.HSSFClientAnchor; <br /> </span><span style="color: #008080">10</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.hssf.usermodel.HSSFPatriarch; <br /> </span><span style="color: #008080">11</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.hssf.usermodel.HSSFSheet; <br /> </span><span style="color: #008080">12</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.poi.hssf.usermodel.HSSFWorkbook; <br /> </span><span style="color: #008080">13</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> </span><span style="color: #008080">14</span><span style="color: #000000"><img id="Codehighlighter1_411_1858_Open_Image" onclick="this.style.display='none'; Codehighlighter1_411_1858_Open_Text.style.display='none'; Codehighlighter1_411_1858_Closed_Image.style.display='inline'; Codehighlighter1_411_1858_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_411_1858_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_411_1858_Closed_Text.style.display='none'; Codehighlighter1_411_1858_Open_Image.style.display='inline'; Codehighlighter1_411_1858_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> PicExcelTest </span><span id="Codehighlighter1_411_1858_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_411_1858_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">15</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> </span><span style="color: #008080">16</span><span style="color: #000000"><img id="Codehighlighter1_477_1235_Open_Image" onclick="this.style.display='none'; Codehighlighter1_477_1235_Open_Text.style.display='none'; Codehighlighter1_477_1235_Closed_Image.style.display='inline'; Codehighlighter1_477_1235_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_477_1235_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_477_1235_Closed_Text.style.display='none'; Codehighlighter1_477_1235_Open_Image.style.display='inline'; Codehighlighter1_477_1235_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args) </span><span style="color: #0000ff">throws</span><span style="color: #000000"> IOException </span><span id="Codehighlighter1_477_1235_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_477_1235_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">17</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         <br /> </span><span style="color: #008080">18</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        FileOutputStream out </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> FileOutputStream(</span><span style="color: #000000">"</span><span style="color: #000000">D:/workbook.xls</span><span style="color: #000000">"</span><span style="color: #000000">);   <br /> </span><span style="color: #008080">19</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        HSSFWorkbook wb </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> HSSFWorkbook(); <br /> </span><span style="color: #008080">20</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />         <br /> </span><span style="color: #008080">21</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        HSSFSheet sheet1 </span><span style="color: #000000">=</span><span style="color: #000000"> wb.createSheet(</span><span style="color: #000000">"</span><span style="color: #000000">picture</span><span style="color: #000000">"</span><span style="color: #000000">); <br /> </span><span style="color: #008080">22</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        HSSFPatriarch patriarch </span><span style="color: #000000">=</span><span style="color: #000000"> sheet1.createDrawingPatriarch();;    <br /> </span><span style="color: #008080">23</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        HSSFClientAnchor anchor1 </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> HSSFClientAnchor(</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #000000">0</span><span style="color: #000000">,(</span><span style="color: #0000ff">short</span><span style="color: #000000">)</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #000000">0</span><span style="color: #000000">,(</span><span style="color: #0000ff">short</span><span style="color: #000000">)</span><span style="color: #000000">8</span><span style="color: #000000">,</span><span style="color: #000000">20</span><span style="color: #000000">); <br /> </span><span style="color: #008080">24</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        HSSFClientAnchor anchor2 </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> HSSFClientAnchor(</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #000000">0</span><span style="color: #000000">,(</span><span style="color: #0000ff">short</span><span style="color: #000000">)</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #000000">24</span><span style="color: #000000">,(</span><span style="color: #0000ff">short</span><span style="color: #000000">)</span><span style="color: #000000">8</span><span style="color: #000000">,</span><span style="color: #000000">44</span><span style="color: #000000">);  <br /> </span><span style="color: #008080">25</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        patriarch.createPicture(anchor1, wb.addPicture(loadImage(</span><span style="color: #000000">"</span><span style="color: #000000">D:/Sunset.jpg</span><span style="color: #000000">"</span><span style="color: #000000">),HSSFWorkbook.PICTURE_TYPE_JPEG));     <br /> </span><span style="color: #008080">26</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        patriarch.createPicture(anchor2, wb.addPicture(loadImage(</span><span style="color: #000000">"</span><span style="color: #000000">D:/Water lilies.jpg</span><span style="color: #000000">"</span><span style="color: #000000">),HSSFWorkbook.PICTURE_TYPE_JPEG)); <br /> </span><span style="color: #008080">27</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />      <br /> </span><span style="color: #008080">28</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        wb.write(out);   <br /> </span><span style="color: #008080">29</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        out.close();  <br /> </span><span style="color: #008080">30</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"> <br /> </span><span style="color: #008080">31</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />     <br /> </span><span style="color: #008080">32</span><span style="color: #000000"><img id="Codehighlighter1_1296_1855_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1296_1855_Open_Text.style.display='none'; Codehighlighter1_1296_1855_Closed_Image.style.display='inline'; Codehighlighter1_1296_1855_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1296_1855_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1296_1855_Closed_Text.style.display='none'; Codehighlighter1_1296_1855_Open_Image.style.display='inline'; Codehighlighter1_1296_1855_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">byte</span><span style="color: #000000">[] loadImage(String filePath) </span><span id="Codehighlighter1_1296_1855_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1296_1855_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">33</span><span style="color: #000000"><img id="Codehighlighter1_1311_1769_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1311_1769_Open_Text.style.display='none'; Codehighlighter1_1311_1769_Closed_Image.style.display='inline'; Codehighlighter1_1311_1769_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1311_1769_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1311_1769_Closed_Text.style.display='none'; Codehighlighter1_1311_1769_Open_Image.style.display='inline'; Codehighlighter1_1311_1769_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">try</span><span style="color: #000000"> </span><span id="Codehighlighter1_1311_1769_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1311_1769_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">34</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            FileInputStream input </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> FileInputStream(</span><span style="color: #0000ff">new</span><span style="color: #000000"> File(filePath)); <br /> </span><span style="color: #008080">35</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            ByteArrayOutputStream output </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ByteArrayOutputStream(); <br /> </span><span style="color: #008080">36</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">byte</span><span style="color: #000000"> buf[] </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> </span><span style="color: #0000ff">byte</span><span style="color: #000000">[</span><span style="color: #000000">1024</span><span style="color: #000000">]; <br /> </span><span style="color: #008080">37</span><span style="color: #000000"><img id="Codehighlighter1_1528_1758_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1528_1758_Open_Text.style.display='none'; Codehighlighter1_1528_1758_Closed_Image.style.display='inline'; Codehighlighter1_1528_1758_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1528_1758_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1528_1758_Closed_Text.style.display='none'; Codehighlighter1_1528_1758_Open_Image.style.display='inline'; Codehighlighter1_1528_1758_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">for</span><span style="color: #000000"> (;;) </span><span id="Codehighlighter1_1528_1758_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1528_1758_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">38</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                </span><span style="color: #0000ff">int</span><span style="color: #000000"> noBytesRead </span><span style="color: #000000">=</span><span style="color: #000000"> input.read(buf); <br /> </span><span style="color: #008080">39</span><span style="color: #000000"><img id="Codehighlighter1_1622_1691_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1622_1691_Open_Text.style.display='none'; Codehighlighter1_1622_1691_Closed_Image.style.display='inline'; Codehighlighter1_1622_1691_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1622_1691_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1622_1691_Closed_Text.style.display='none'; Codehighlighter1_1622_1691_Open_Image.style.display='inline'; Codehighlighter1_1622_1691_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />                </span><span style="color: #0000ff">if</span><span style="color: #000000"> (noBytesRead </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000">) </span><span id="Codehighlighter1_1622_1691_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1622_1691_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">40</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                    </span><span style="color: #0000ff">return</span><span style="color: #000000"> output.toByteArray(); <br /> </span><span style="color: #008080">41</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />                }</span></span><span style="color: #000000"> <br /> </span><span style="color: #008080">42</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                output.write(buf, </span><span style="color: #000000">0</span><span style="color: #000000">, noBytesRead); <br /> </span><span style="color: #008080">43</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />            }</span></span><span style="color: #000000"> <br /> </span><span style="color: #008080">44</span><span style="color: #000000"><img id="Codehighlighter1_1793_1848_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1793_1848_Open_Text.style.display='none'; Codehighlighter1_1793_1848_Closed_Image.style.display='inline'; Codehighlighter1_1793_1848_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1793_1848_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1793_1848_Closed_Text.style.display='none'; Codehighlighter1_1793_1848_Open_Image.style.display='inline'; Codehighlighter1_1793_1848_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        }</span></span><span style="color: #000000"> </span><span style="color: #0000ff">catch</span><span style="color: #000000"> (IOException e) </span><span id="Codehighlighter1_1793_1848_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1793_1848_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">45</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">throw</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> RuntimeException(e); <br /> </span><span style="color: #008080">46</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"> <br /> </span><span style="color: #008080">47</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"> <br /> </span><span style="color: #008080">48</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">49</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <img src ="http://www.tkk7.com/Vincent-chenxj/aggbug/242488.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/Vincent-chenxj/" target="_blank">Vincent-chen</a> 2008-11-25 11:40 <a href="http://www.tkk7.com/Vincent-chenxj/articles/242488.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>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闃呰鍏ㄦ枃

]]>
主站蜘蛛池模板: 亚洲国产区男人本色在线观看| 成年女人喷潮毛片免费播放 | 国产a视频精品免费观看| 亚洲熟女少妇一区二区| 精品乱子伦一区二区三区高清免费播放| 午夜电影免费观看| 亚洲精品伦理熟女国产一区二区| 无人影院手机版在线观看免费| 日韩亚洲产在线观看| 成人免费无遮挡无码黄漫视频| 香蕉大伊亚洲人在线观看| 午夜色a大片在线观看免费| 在线播放亚洲精品| 国产精品xxxx国产喷水亚洲国产精品无码久久一区 | 亚洲婷婷五月综合狠狠爱| 久久免费视频99| 亚洲不卡在线观看| 午夜毛片不卡免费观看视频| 亚洲成在人线aⅴ免费毛片| 亚洲国产成人久久笫一页| 国产又黄又爽胸又大免费视频| 亚洲国产精品无码成人片久久| 一级特黄aa毛片免费观看| 亚洲卡一卡二卡乱码新区| 成人国产mv免费视频| 一区在线免费观看| 久久久久久亚洲av成人无码国产| 无码乱肉视频免费大全合集| 亚洲国产成人AV在线播放| 久久久久国产成人精品亚洲午夜| 四虎影视在线影院在线观看免费视频| 亚洲人成电影网站| 全部免费毛片在线| 久9这里精品免费视频| 中国亚洲呦女专区| 奇米影视亚洲春色| 在线v片免费观看视频| 2022国内精品免费福利视频| 亚洲成电影在线观看青青| 亚洲国产一区二区视频网站| 88av免费观看|