??xml version="1.0" encoding="utf-8" standalone="yes"?>91精品国产综合久久香蕉,国外成人在线视频,久久青草精品视频免费观看http://www.aygfsteel.com/leekiang/category/29573.htmlMDA/MDD/TDD/DDD/DDDDDDDzh-cnFri, 18 Mar 2011 22:52:53 GMTFri, 18 Mar 2011 22:52:53 GMT60正则表达式笔?/title><link>http://www.aygfsteel.com/leekiang/archive/2010/04/21/318955.html</link><dc:creator>leekiang</dc:creator><author>leekiang</author><pubDate>Wed, 21 Apr 2010 04:30:00 GMT</pubDate><guid>http://www.aygfsteel.com/leekiang/archive/2010/04/21/318955.html</guid><wfw:comment>http://www.aygfsteel.com/leekiang/comments/318955.html</wfw:comment><comments>http://www.aygfsteel.com/leekiang/archive/2010/04/21/318955.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/leekiang/comments/commentRss/318955.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/leekiang/services/trackbacks/318955.html</trackback:ping><description><![CDATA[String regex = "<a.*?/a>";//取链?br />        Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);<br />        Matcher mt = pattern.matcher(str);<br />        while (mt.find()) {<br />        String s=mt.group();<br />        }<br />        String regex2 = ">.*?</a>";// 标题部分<br />        String regex3 = "imgs/[([0-9])]+.(jpg|gif|png|bmp)";//取图?br /><br />输入例子可生正则表辑ּ<br />http://sourceforge.net/projects/quickrex/<br /><br />在线试<br />http://www.fileformat.info/tool/regex.htm<br /><br /><img src ="http://www.aygfsteel.com/leekiang/aggbug/318955.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/leekiang/" target="_blank">leekiang</a> 2010-04-21 12:30 <a href="http://www.aygfsteel.com/leekiang/archive/2010/04/21/318955.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>dom4j用法http://www.aygfsteel.com/leekiang/archive/2009/10/25/299681.htmlleekiangleekiangSun, 25 Oct 2009 10:43:00 GMThttp://www.aygfsteel.com/leekiang/archive/2009/10/25/299681.htmlhttp://www.aygfsteel.com/leekiang/comments/299681.htmlhttp://www.aygfsteel.com/leekiang/archive/2009/10/25/299681.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/299681.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/299681.html   应该使用Document document = saxReader.read(new ByteArrayInputStream(xml.getBytes())); 
如果使用Document   document   =   saxReader.read(xml);会报no protocol 异常
如果xml的encoding="utf-8"Q则xml.getBytes()要改为xml.getBytes("utf-8"),否则会报?br />
Element root=  document.getRootElement();
得到root后取子元素,既可?br />Element e=root.element("test");
也可?br />for (Iterator it = root.elementIterator(); it.hasNext();) {
Element e = (Element) it.next();
    String n = e.getName();
   String v=e.getStringValue()
}


http://www.javatx.cn/clubPage.jsp?ccStyle=0&ccID=15&tID=1922
http://lavasoft.blog.51cto.com/62575/66953

leekiang 2009-10-25 18:43 发表评论
]]>
U文本文档格?/title><link>http://www.aygfsteel.com/leekiang/archive/2009/08/30/293227.html</link><dc:creator>leekiang</dc:creator><author>leekiang</author><pubDate>Sun, 30 Aug 2009 13:34:00 GMT</pubDate><guid>http://www.aygfsteel.com/leekiang/archive/2009/08/30/293227.html</guid><wfw:comment>http://www.aygfsteel.com/leekiang/comments/293227.html</wfw:comment><comments>http://www.aygfsteel.com/leekiang/archive/2009/08/30/293227.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/leekiang/comments/commentRss/293227.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/leekiang/services/trackbacks/293227.html</trackback:ping><description><![CDATA[DocBook?reStructuredText都是U文本文档格式。也可以考虑xlst<br />StructuredText和reStructuredText不一?br /><br />Sphinx单来_是一个文档生成工P用于把reStructuredText 格式的源文g生成诸如HTML, PDF, LaTex一cȝ格式。编辑者无M自处理文本的格式, E序会自动根据源文g里的讄产生格式, 以及自动生成章节链接{工作?br />包括 Python , Django 的文档,全部是用Sphinx 生成?br />http://sphinx.pocoo.org/<br /><br />我是如何写博客的<br />http://www.cnblogs.com/mindsbook/archive/2009/07/09/how_do_i_write_blog.html<br />http://www.cnblogs.com/mindsbook/archive/2009/07/15/how_can_i_write_blog_part2.html<br />该文主要介绍了如何?<a class="reference external" >restructuredText</a> (UCؓreST)来写博客Q?q且介绍了?<a class="reference external" >google code</a> 来管理博客源文g的方法?br /><br />另,Sphinx是一个基于SQL的全文检索引擎,可以l合MySQL,PostgreSQL做全文搜索,它可以提供比数据库本w更专业的搜索功能,使得应用E序更容易实C业化的全文检索。Sphinx特别Z些脚本语a设计搜烦API接口Q如PHP,Python,Perl,Ruby{,同时为MySQL 也设计了一个存储引擎插?br /><br />txt2tags 支持带数字编L标题<br />从txt2tags回归markdown  http://sinolog.it/?p=503<br /><br />再找找比较好的wikiQ?br />MediaWiki全球最著名的开源wiki引擎Q运行于PHP+MySQL环境?br />ViKiQ?是 VIM WiKi 的羃写?WiKi 是一U非常方便快捷地l织信息的方式, ?ViKi 作ؓ一U“Personal WiKi”, 能够非常快捷地完成个Z늚制作Q?ViKi 可以支持许多很复杂, 功能很强大的语法。deplate是viki的编译工兗?br /><br />Javascript闭包真经http://w3er.com/blog/2009/03/master-javascript-closure/<br /><br />Stack Overflow和GitHub都在用markdown<br />wmd(http://wmd-editor.com,https://github.com/derobins/wmd)是一个专门ؓMarkdown做的在线~辑?StackOverflow和qingbo.net也用?br />https://github.com/philc/vimium/blob/master/README.markdown<br /><a target="_blank" >Markdown 语法</a><br /><a target="_blank" >支持列编辑模式的~辑?/a><br /><a target="_blank" >showoff</a>支持用编写markdown脚本的方式在览器里昄pptQ?a target="_blank" >例子</a><br /><a >在Vim中发布博客内容到WordPress</a> (reStructuredText)<br /><br />目前最完善的介l轻量标记语言的资料:http://en.wikipedia.org/wiki/Lightweight_markup_language<br />以后不要叫结构化文本了,因ؓStructured Text已有另外的含义,?a target="_blank" >l基癄</a><br /><img src ="http://www.aygfsteel.com/leekiang/aggbug/293227.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/leekiang/" target="_blank">leekiang</a> 2009-08-30 21:34 <a href="http://www.aygfsteel.com/leekiang/archive/2009/08/30/293227.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>POI处理Excel公式的ؕ码问?/title><link>http://www.aygfsteel.com/leekiang/archive/2009/07/29/288896.html</link><dc:creator>leekiang</dc:creator><author>leekiang</author><pubDate>Wed, 29 Jul 2009 07:59:00 GMT</pubDate><guid>http://www.aygfsteel.com/leekiang/archive/2009/07/29/288896.html</guid><wfw:comment>http://www.aygfsteel.com/leekiang/comments/288896.html</wfw:comment><comments>http://www.aygfsteel.com/leekiang/archive/2009/07/29/288896.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/leekiang/comments/commentRss/288896.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/leekiang/services/trackbacks/288896.html</trackback:ping><description><![CDATA[前几天做目的过E中Q利用到Apache目中的POI来实现基于Excel的数据模板输出,其中利用公式的方式嵌入超链接q行|页链接讉K?  <br />   自己做了一些处理EXCEL单元格的ҎQ但在进行公式处理时Q由于POI的问题,昄的公式信息一直都是ؕ码,后来在网上找C些朋友关于这些问题的? x法,感觉帮助很大。因此,l合自己的实늻验,把修改POI内部源码的过E写出来Q以其对资料做一整理Q希望对后来的朋友也有所帮助?  <br />     <br />   1、首先,上网扑ֈPOI的发布版本的源码Q我下的是poi-src-2.5.1-final-20040804.zipq个版本?  <br />   2、找到StringPtg.javaq个文gQ在解压后的\src\java\org\apache\poi\hssf\record\formula文g夹下?  <br />   3、利用文本编辑工具对StringPtg.javaq行~辑   <br />   4、找到public   StringPtg(byte   []   data,   int   offset)q个ҎQ?  <br />   对其修改如下   <br />   /**   Create   a   StringPtg   from   a   byte   array   read   from   disk   */   <br />           public   StringPtg(byte   []   data,   int   offset)   <br />           {   <br />                   offset++;   <br />                   field_1_length   =   data[offset];   <br />                   field_2_options   =   data[offset+1];   <br />                   if   (fHighByte.isSet(field_2_options))   {   <br />                           //   modified   by   rainsoft     <br />                           //   in   excel   chinese   is   stored   two   bytes   HIGH   bytes,LOW   bytes   <br />                           //   field_3_string=   StringUtil.getFromUnicode(data,offset+2,field_1_length);   <br />                           field_3_string=   StringUtil.getFromUnicodeHigh(data,offset+2,field_1_length);   <br />                   }else   {   <br />                           field_3_string=StringUtil.getFromCompressedUnicode(data,offset+2,field_1_length);   <br />                   }   <br />                                       <br />                   //setValue(new   String(data,   offset+3,   data[offset+1]   +   256*data[offset+2]));   <br />           }   <br />   其中主要利用getFromUnicodeHighҎ替换原有的方法进行处理?  <br />   5、再查找StringPtg(String   value)Q做如下的修改,   <br />     <br />   public   StringPtg(String   value)   {   <br />                   if   (value.length()   >255)   {   <br />                           throw   new   IllegalArgumentException("String   literals   in   formulas   cant   be   bigger   than   255   characters   ASCII");   <br />                   }   <br />                   this.field_2_options=0;   <br />                   //   add   by   rainsoft   <br />                   //   two   bytes   char   options   must   be   "1"               <br />                   try   {   <br />                       if   (value.length()!=value.getBytes("GBK").length)   <br />                           this.field_2_options=1;   <br />                   }   catch   (Exception   e)   {   <br />                   }   <br />                   //   end   add   <br />                   this.fHighByte.setBoolean(field_2_options,   false);   <br />                   this.field_3_string=value;   <br />                   this.field_1_length=(byte)value.length();   //for   the   moment,   we   support   only   ASCII   strings   in   formulas   we   create   <br />           }   <br />     <br />   6、至此对源文件的修改q束了Q下一步则需要对其进行编译输出?  <br />   7、利用docs/howtobuild.html的描q进行编译输出?  <br />   8、成功编译输出的POI???????.jar文gQ复制到原有的编译\径,替换到原有的文g卛_Q最好删除原有的   POI文g。?<br />http://topic.csdn.net/t/20060309/10/4602637.html<br /><img src ="http://www.aygfsteel.com/leekiang/aggbug/288896.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/leekiang/" target="_blank">leekiang</a> 2009-07-29 15:59 <a href="http://www.aygfsteel.com/leekiang/archive/2009/07/29/288896.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用poi生成链接http://www.aygfsteel.com/leekiang/archive/2008/10/21/235794.htmlleekiangleekiangTue, 21 Oct 2008 14:11:00 GMThttp://www.aygfsteel.com/leekiang/archive/2008/10/21/235794.htmlhttp://www.aygfsteel.com/leekiang/comments/235794.htmlhttp://www.aygfsteel.com/leekiang/archive/2008/10/21/235794.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/235794.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/235794.html一个需求, 要求报表生成的Excel表格支持链接。例如点击Excel内的公司名, 自动打开览器ƈq到该公司的|站上去。在Excel里面选中所需的单元格Q?右键弹出属性, 选超链接p输入相应的地址了,既然Excel支持链接。那没有什么借口说不能实C?).

MPOI的文档, 很容易就扑ֈ了解x案。在POI中让单元格实现超链接功能Q?可以用Hyperlink 函数。HYPERLINK函数包含两个参数Q?font color="#0000ff">W一个参数是指向的地址Q第二个参数是显C的字符?/font>

cell = row.createCell(colNumber)?br />cell.setCellType(HSSFCell.CELL_TYPE_FORMULA);
cell.setCellFormula("HYPERLINK(\"" + "Http://www.google.ca"+ "\",\"" + "Google Canada"+ "\")");
或cell.setCellFormula("HYPERLINK(\"[workbook.xls]'sheet2'!A1\",\"homepage\")"); //HYPERLINK("#明细!A1","homepage"),#代表本工作簿Q来源http://club.excelhome.net/thread-54081-1-1.html

现在链接单元格看v来和一般的单元格没有分别, 除非你把鼠标放上L会变成手行光标?Z和一般的习惯相符Q?q需要把字符颜色变成蓝色和加上下划线?q就要用?style了?br />
HSSFCellStyle linkStyle = workbook.createCellStyle();
HSSFFont cellFont= workbook.createFont();
cellFont.setUnderline((byte) 1);
cellFont.setColor(HSSFColor.BLUE.index);
linkStyle.setFont(cellFont);

最后把style应用到cell上去大功告成了?br />cell.setCellStyle(linkStyle);

以上修改自http://sunnylei2008.blogspot.com/2007/07/poihssf.html
和http://diystyle.javaeye.com/blog/132093
q有http://blog.csdn.net/xunyiren/archive/2007/03/08/1524533.aspx

2Q?br />以下来自http://www.javaeye.com/topic/25569,是用jxl解决的?br />看了POI文档Q找C个LinkedDataFormulaField 和LinkedDataRecordQjxl文档里有 Hyperlink,现在惛_一个excel中的一lsheet做一个烦引,方便查找每张sheet,
String outputFile="D:/导出接口.xls";
try
{
Workbook wb=Workbook.getWorkbook(new File(outputFile)); //Excel获得文g
//打开一个文件的副本Qƈ且指定数据写回到原文?br />WritableWorkbook book=Workbook.createWorkbook(new File(outputFile),wb);
WritableSheet sheet=book.createSheet("导出目标",0); //d一个工作表
String[] oriSheetNames=wb.getSheetNames();  //获得源excel文g中的所有sheet名称
 for(int i=0;i<book.getNumberOfSheets();i++)
 {
    sheet.addCell(new Label(0,i+1,String.valueOf(i+1)));  //W一列写入编?br />/**
* public WritableHyperlink(int col,int row,java.lang.String desc,WritableSheet sheet,int destcol,int destrow)
* Constructs a hyperlink to some cells within this workbook
* col - the column containing this hyperlink
* row - the row containing this hyperlink
* desc - the cell contents for this hyperlink
* sheet - the sheet containing the cells to be linked to
* destcol - the column number of the first destination linked cell
* destrow - the row number of the first destination linked cell
* */
sheet.addHyperlink(new WritableHyperlink(1,i+1,oriSheetNames[i],book.getSheet(oriSheetNames[i]),0,0));
book.write();
book.close();
wb.close();
}catch(IOException e)
{
    System.out.println("异常: "+e);
}
catch(BiffException e)
{
    System.out.println("异常: "+e);
}
catch(RowsExceededException e)
{
    System.out.println("异常: "+e);
}
catch(WriteException e)
{
    System.out.println("异常: "+e);
}

3Q公式里的ؕ码如何解?来源:http://topic.csdn.net/t/20060309/10/4602637.html,作者阿?br />前几天做目的过E中Q利用到Apache目中的POI来实现基于Excel的数据模板输出,其中利用公式的方式嵌入超链接q行|页链接讉K? 
  自己做了一些处理EXCEL单元格的ҎQ但在进行公式处理时Q由于POI的问题,昄的公式信息一直都是ؕ码,后来在网上找C些朋友关于这些问题的? x法,感觉帮助很大。因此,l合自己的实늻验,把修改POI内部源码的过E写出来Q以其对资料做一整理Q希望对后来的朋友也有所帮助? 
   
  1、首先,上网扑ֈPOI的发布版本的源码Q我下的是poi-src-2.5.1-final-20040804.zipq个版本? 
  2、找到StringPtg.javaq个文gQ在解压后的\src\java\org\apache\poi\hssf\record\formula文g夹下? 
  3、利用文本编辑工具对StringPtg.javaq行~辑  
  4、找到public   StringPtg(byte   []   data,   int   offset)q个ҎQ? 
  对其修改如下  
  /**   Create   a   StringPtg   from   a   byte   array   read   from   disk   */  
          public   StringPtg(byte   []   data,   int   offset)  
          {  
                  offset++;  
                  field_1_length   =   data[offset];  
                  field_2_options   =   data[offset+1];  
                  if   (fHighByte.isSet(field_2_options))   {  
                          //   modified   by   rainsoft    
                          //   in   excel   chinese   is   stored   two   bytes   HIGH   bytes,LOW   bytes  
                          //   field_3_string=   StringUtil.getFromUnicode(data,offset+2,field_1_length);  
                          field_3_string=   StringUtil.getFromUnicodeHigh(data,offset+2,field_1_length);  
                  }else   {  
                          field_3_string=StringUtil.getFromCompressedUnicode(data,offset+2,field_1_length);  
                  }  
                                     
                  //setValue(new   String(data,   offset+3,   data[offset+1]   +   256*data[offset+2]));  
          }  
  其中主要利用getFromUnicodeHighҎ替换原有的方法进行处理? 
  5、再查找StringPtg(String   value)Q做如下的修改,  
   
  public   StringPtg(String   value)   {  
                  if   (value.length()   >255)   {  
                          throw   new   IllegalArgumentException("String   literals   in   formulas   cant   be   bigger   than   255   characters   ASCII");  
                  }  
                  this.field_2_options=0;  
                  //   add   by   rainsoft  
                  //   two   bytes   char   options   must   be   "1"              
                  try   {  
                      if   (value.length()!=value.getBytes("GBK").length)  
                          this.field_2_options=1;  
                  }   catch   (Exception   e)   {  
                  }  
                  //   end   add  
                  this.fHighByte.setBoolean(field_2_options,   false);  
                  this.field_3_string=value;  
                  this.field_1_length=(byte)value.length();   //for   the   moment,   we   support   only   ASCII   strings   in   formulas   we   create  
          }  
   
  6、至此对源文件的修改q束了Q下一步则需要对其进行编译输出? 
  7、利用docs/howtobuild.html的描q进行编译输出? 

后注:按上面的办法,中文问题是解决了Q但点击链接q是?引用无效",观察了一会,原来是sheet名带有括号造成的?/font>
 



leekiang 2008-10-21 22:11 发表评论
]]>
YAML格式解析http://www.aygfsteel.com/leekiang/archive/2008/06/19/209249.htmlleekiangleekiangThu, 19 Jun 2008 12:27:00 GMThttp://www.aygfsteel.com/leekiang/archive/2008/06/19/209249.htmlhttp://www.aygfsteel.com/leekiang/comments/209249.htmlhttp://www.aygfsteel.com/leekiang/archive/2008/06/19/209249.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/209249.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/209249.html写YAML要比XML快得?无需关闭标签或引?Qƈ且比'.ini'文档功能更强(ini文档不支持层?

Z么不是XML呢?因ؓQ?/p>

  • YAML的可L好?
  • YAML和脚本语a的交互性好?
  • YAML使用实现语言的数据类型?
  • YAML有一个一致的信息模型?
  • YAML易于实现?

上面5条也是XML不的地斏V同ӞYAML也有XML的下列优点:

  • YAML可以Z来处理Q?
  • YAML表达能力强,扩展性好?

MQYAML试图用一U比XML更敏L方式Q来完成XML所完成的Q务?/p>

语法

Structure通过I格来展C。Sequence里的用"-"来代表,Map里的键值对?:"分隔.

q几乎就是所有的语法? 例子

name: John Smith
age: 37
spouse:
    name: Jane Smith
    age: 25
children:
    -   name: Jimmy Smith
        age: 15
    -   name: Jenny Smith
        age : 12


JYamlQ?a >http://jyaml.sourceforge.net/Q是YAML的Java实现?br />YAML官方|站 http://www.yaml.org
http://www.ibm.com/developerworks/cn/xml/x-cn-yamlintro/
http://www.sudu.cn/info/html/edu/php/20071219/114014.html
http://www.javaeye.com/topic/205679 Q定义工作流,用ruby解析Q?img src ="http://www.aygfsteel.com/leekiang/aggbug/209249.html" width = "1" height = "1" />

leekiang 2008-06-19 20:27 发表评论
]]>
vCalendar(ics)QvCard格式及Outlookhttp://www.aygfsteel.com/leekiang/archive/2008/04/03/190640.htmlleekiangleekiangThu, 03 Apr 2008 08:15:00 GMThttp://www.aygfsteel.com/leekiang/archive/2008/04/03/190640.htmlhttp://www.aygfsteel.com/leekiang/comments/190640.htmlhttp://www.aygfsteel.com/leekiang/archive/2008/04/03/190640.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/190640.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/190640.htmlhttp://hi.baidu.com/feige05/blog/item/3d7339184c8d9d0334fa4166.html
http://support.microsoft.com/kb/287625/zh-cn
按vcalendar开发理论:用JAVA生成vcalendar代码Q然后发邮g出去Q当用outlook2003版本以上的MS   outlook收到该邮件时Q可以把q个vcalendar加到outlook的calendar中去?/a>
.ics格式的RFC2445规范
XML 问题: 比微格式更轻巧:U格式(PicoformatQ?/a>
iCalendar在移动设?/a>


leekiang 2008-04-03 16:15 发表评论
]]>
poiW记http://www.aygfsteel.com/leekiang/archive/2008/03/14/186391.htmlleekiangleekiangFri, 14 Mar 2008 14:26:00 GMThttp://www.aygfsteel.com/leekiang/archive/2008/03/14/186391.htmlhttp://www.aygfsteel.com/leekiang/comments/186391.htmlhttp://www.aygfsteel.com/leekiang/archive/2008/03/14/186391.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/186391.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/186391.htmlInputStreams passed to POIFSFileSystem are now automatically closed. A warning is generated for people who might've relied on them not being closed before, and a wrapper to restore the old behaviour is supplied(POI-DEVELOPERS)
据说在POI3.0.3会修正该问题?br />
1,poi格子里的文本如何换行
  ?\n",同时讄style.setWrapText(true);
 
2,style.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index);
 style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
 讄前景?有半透明的效?br /> 
3Qsheet.addMergedRegion(new Region(0, (short) 0, 0, (short) 1));// 起始cell行、v始cell列、结束cell行、结束cell列?br />   被合q了的单元格不需要生成?br />   单元格合q後讄Ҏ只在原第一个上有效Q如果想应用的合q後的整体,则需要一个个的Create出单元格q应用样式,q个明显是一个不太方便的操作Q期待POI下一版的改进?br />   注意行是y?列是x轴?br />   poi-contrib下的HSSFRegionUtil可以讄合ƈ区域的边框的颜色和样?br />例如:HSSFRegionUtil.setLeftBorderColor(HSSFColor.BLACK.index,row,sheet,wb);

4Qsheet.createFreezePane(2, 1);
  ȝH口,左上角ؓ行参和列参的起始处,?开?br /> 
5,列宽sheet.setColumnWidth((short) 0, (short) (35.7 * 110));//W一个参Cؓ列的下标Q?10为想讄的宽度像素?br />  http://www.cnblogs.com/interboy/archive/2007/08/27/872028.html

6,行高row.setHeight((short) (15.625 * 100));//100讄的行高的像素
   row.setHeightInPoints((short)100);//应该可以辑ֈ同样的效?br />
7, POI註解的部分Q視做一個文字方塊,我們可以設定它的大及內容Q然後將之指定某特定的Cell?br />节录部分Code如下Q?br />HSSFPatriarch patr = sheet.createDrawingPatriarch();
HSSFComment comment = patr.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short)4, 2, (short) 8, rowCount));
HSSFRichTextString str = new HSSFRichTextString("TEST");
comment.setString(str);
comment.setAuthor("TEST");
cell.setCellComment(comment);

8Qsheet的中文名
workbook.setSheetName(0,"l计",(short)1);//W三个参Cؓ~码方式QHSSFWorkbook.ENCODING_UTF_16=1
sheet的名UC允许出现重复?br />
9Q?先定义一个基本样式,再复制样式的属性。不知何故不能clonebean
  HSSFCellStyle headerStyle = workbook.createCellStyle();
  PropertyUtils.copyProperties(headerStyle, baseStyle);//

10, 输出Q中文名
        response.reset();
        response.setContentType("applicationnd.ms-excel");
        response.addHeader("Content-disposition",
                "attachment;filename="+new String("l计".getBytes("GBK"), "ISO-8859-1")+".xls");
        ServletOutputStream out = response.getOutputStream();
        workbook.write(out);
        out.flush();
        out.close();

11Qcell.setCellValue(new HSSFRichTextString("试"));
在poi2.5.1里不用,只能用cell.setCellValue("试");
忘了二者有何区?br />
12Q直接用workbook.getBytes()得到的文档内容的l构是有问题?会导致打开xls时报错?br />ByteArrayOutputStream bos = new ByteArrayOutputStream();
workBook.write(bos);
//ByteArrayInputStream is = new ByteArrayInputStream(workBook.getBytes());//错误
ByteArrayInputStream is = new ByteArrayInputStream(bos.toByteArray());//正确
详见 http://numenzq.javaeye.com/blog/218816

13,POI的老版本的下蝲地址:http://archive.apache.org/dist/jakarta/poi/release/bin

14,每个sheet?5536的最大行数限?
   数据量非常大Ӟ拆分为多个sheet(每个1万行)可显著降低内存占用?br />   http://www.javaeye.com/topic/74835?page=3

15,可用PropertyUtils.copyProperties(newStyle, baseStyle)把baseStyle的属性拷贝到newStyle中,但Font{拷贝不了?拷?深拷?)

16,POI如何复制?讄分页Wbug? ?/span>使用POI操作Excel的几Ҏ意事?/a>
和http://www.aygfsteel.com/liaojiyong/archive/2007/11/14/160588.html

17,复制行,复制sheet
http://zhidao.baidu.com/question/66868683.html
http://www.aub.org.cn/J2SE/Article137612.html
http://zhidao.baidu.com/question/42447398.html

18,用HSSFCell的getCellType()只能判断三种cdQ返回gؓint   0,1,2  
  numeric(0),   formula(2)   or   string(1)  
  但是仅仅依靠q个有时候不能完全解决问题,  
  有时候需要用HSSFDataFormat来共同判断:  
    cell.getCellStyle().getDataFormat()
见http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/BuiltinFormats.html
  https://svn.apache.org/repos/asf/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDateUtil.java


19Qpoi3.2把以下属性或Ҏ删掉了:
HSSFWorkbook.ENCODING_UTF_16
cell.setEncoding
所以还是l用poi3.0.2?br />        
http://blog.csdn.net/impeller/archive/2007/10/29/1855368.aspx
解析Excel注释Q填充ƈ生成报表的一个例?/a>
http://hi.baidu.com/bluewhale84/blog/item/b9ebd5c295911130e4dd3bd0.html
http://kevintuntun.bokee.com/2692649.html
http://www.ccw.com.cn/htm/center/prog/02_10_22_2.asp
http://llying.javaeye.com/blog/171455
http://hi.baidu.com/fish1996/blog/item/71412181e9825bdabd3e1eed.html(toutf8string)
poi的一个让人失望的bug

openxml4j支持excel2007




leekiang 2008-03-14 22:26 发表评论
]]>
备忘http://www.aygfsteel.com/leekiang/archive/2008/02/26/182113.htmlleekiangleekiangMon, 25 Feb 2008 20:44:00 GMThttp://www.aygfsteel.com/leekiang/archive/2008/02/26/182113.htmlhttp://www.aygfsteel.com/leekiang/comments/182113.htmlhttp://www.aygfsteel.com/leekiang/archive/2008/02/26/182113.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/182113.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/182113.html有关《java抽取word,pdf的四U武器》的实验和ȝ
Java抽取WordQPDF的四U武?/a>
使用poi来抽取excel文本
用pdfbox解析pdf文g
poi
spring集成的Hibernate一H?/a>
使用sqlquery
全文索Lucene的实现方?/a>

Ganttproject可以用来生成甘特?br /> 文本比较http://www.incava.org/projects/java/java-diff/

leekiang 2008-02-26 04:44 发表评论
]]>
html的解析以及nekohtml的?/title><link>http://www.aygfsteel.com/leekiang/archive/2008/02/21/181163.html</link><dc:creator>leekiang</dc:creator><author>leekiang</author><pubDate>Thu, 21 Feb 2008 10:29:00 GMT</pubDate><guid>http://www.aygfsteel.com/leekiang/archive/2008/02/21/181163.html</guid><wfw:comment>http://www.aygfsteel.com/leekiang/comments/181163.html</wfw:comment><comments>http://www.aygfsteel.com/leekiang/archive/2008/02/21/181163.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/leekiang/comments/commentRss/181163.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/leekiang/services/trackbacks/181163.html</trackback:ping><description><![CDATA[ <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"> <!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--> <span style="color: rgb(0, 0, 255);">    import</span> <span style="color: rgb(0, 0, 0);"> org.cyberneko.html.parsers.DOMFragmentParser;<br />     import org.apache.html.dom.HTMLDocumentImpl;<br />    </span> <span style="color: rgb(0, 0, 255);">import</span> <span style="color: rgb(0, 0, 0);"> org.w3c.dom.DocumentFragment;<br />    </span> <span style="color: rgb(0, 0, 255);">import</span> <span style="color: rgb(0, 0, 0);"> org.w3c.dom.Node;<br />    </span> <span style="color: rgb(0, 0, 255);">import</span> <span style="color: rgb(0, 0, 0);"> org.w3c.dom.NodeList;<br />    </span> <span style="color: rgb(0, 0, 255);">import</span> <span style="color: rgb(0, 0, 0);"> org.xml.sax.InputSource;<br />    </span> <span style="color: rgb(0, 0, 255);">import</span> <span style="color: rgb(0, 0, 0);"> org.xml.sax.SAXException;<br /><br />    </span> <span style="color: rgb(0, 128, 0);">/**</span> <span style="color: rgb(0, 128, 0);"> <br />     * 从html中抽取纯文本<br />     * <br />     * </span> <span style="color: rgb(128, 128, 128);">@param</span> <span style="color: rgb(0, 128, 0);"> content<br />     * </span> <span style="color: rgb(128, 128, 128);">@return</span> <span style="color: rgb(0, 128, 0);"> <br />     * </span> <span style="color: rgb(128, 128, 128);">@throws</span> <span style="color: rgb(0, 128, 0);"> UnsupportedEncodingException<br />     </span> <span style="color: rgb(0, 128, 0);">*/</span> <span style="color: rgb(0, 0, 0);"> <br />    </span> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 0);"> String extractTextFromHTML(String content)<br />            </span> <span style="color: rgb(0, 0, 255);">throws</span> <span style="color: rgb(0, 0, 0);"> UnsupportedEncodingException {<br />        DOMFragmentParser parser </span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> </span> <span style="color: rgb(0, 0, 255);">new</span> <span style="color: rgb(0, 0, 0);"> DOMFragmentParser();<br />        DocumentFragment node </span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> </span> <span style="color: rgb(0, 0, 255);">new</span> <span style="color: rgb(0, 0, 0);"> HTMLDocumentImpl().createDocumentFragment();<br />        InputStream is </span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> </span> <span style="color: rgb(0, 0, 255);">new</span> <span style="color: rgb(0, 0, 0);"> ByteArrayInputStream(content.getBytes());<br />        </span> <span style="color: rgb(0, 0, 255);">try</span> <span style="color: rgb(0, 0, 0);"> {<br />            parser.parse(</span> <span style="color: rgb(0, 0, 255);">new</span> <span style="color: rgb(0, 0, 0);"> InputSource(is), node);<br />        } </span> <span style="color: rgb(0, 0, 255);">catch</span> <span style="color: rgb(0, 0, 0);"> (IOException e) {<br />            e.printStackTrace();<br />        } </span> <span style="color: rgb(0, 0, 255);">catch</span> <span style="color: rgb(0, 0, 0);"> (SAXException se) {<br />            se.printStackTrace();<br />        }<br /><br />        StringBuffer newContent </span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> </span> <span style="color: rgb(0, 0, 255);">new</span> <span style="color: rgb(0, 0, 0);"> StringBuffer();<br />        </span> <span style="color: rgb(0, 0, 255);">this</span> <span style="color: rgb(0, 0, 0);">.getText(newContent, node);<br /><br />        String str </span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> (</span> <span style="color: rgb(0, 0, 255);">new</span> <span style="color: rgb(0, 0, 0);"> String(<br />                newContent.toString().getBytes(</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">Windows-1252</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">), </span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">GBK</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">));<br />        </span> <span style="color: rgb(0, 0, 255);">return</span> <span style="color: rgb(0, 0, 0);"> str;<br />    }<br /><br />    </span> <span style="color: rgb(0, 0, 255);">private</span> <span style="color: rgb(0, 0, 0);"> </span> <span style="color: rgb(0, 0, 255);">void</span> <span style="color: rgb(0, 0, 0);"> getText(StringBuffer sb, Node node) {<br />        </span> <span style="color: rgb(0, 0, 255);">if</span> <span style="color: rgb(0, 0, 0);"> (node.getNodeType() </span> <span style="color: rgb(0, 0, 0);">==</span> <span style="color: rgb(0, 0, 0);"> Node.TEXT_NODE) {<br />            sb.append(node.getNodeValue());<br />        }<br />        NodeList children </span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> node.getChildNodes();<br />        </span> <span style="color: rgb(0, 0, 255);">if</span> <span style="color: rgb(0, 0, 0);"> (children </span> <span style="color: rgb(0, 0, 0);">!=</span> <span style="color: rgb(0, 0, 0);"> </span> <span style="color: rgb(0, 0, 255);">null</span> <span style="color: rgb(0, 0, 0);">) {<br />            </span> <span style="color: rgb(0, 0, 255);">int</span> <span style="color: rgb(0, 0, 0);"> len </span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> children.getLength();<br />            </span> <span style="color: rgb(0, 0, 255);">for</span> <span style="color: rgb(0, 0, 0);"> (</span> <span style="color: rgb(0, 0, 255);">int</span> <span style="color: rgb(0, 0, 0);"> i </span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> </span> <span style="color: rgb(0, 0, 0);">0</span> <span style="color: rgb(0, 0, 0);">; i </span> <span style="color: rgb(0, 0, 0);"><</span> <span style="color: rgb(0, 0, 0);"> len; i</span> <span style="color: rgb(0, 0, 0);">++</span> <span style="color: rgb(0, 0, 0);">) {<br />                getText(sb, children.item(i));<br />            }<br />        }<br />    }</span> </div> <br />1Qnekohtml1.9.6.1版本用到了jdk5的Arrays.hashCode{方法,为兼容jdk1.4,<br />  故采用nekohtml1.9.6版本<br />2Q需要xerces.jar支持<br />3Q?br />   http://hi.baidu.com/walkandsing/blog/item/f5743634c6ba2e3a5bb5f5e5.html<br />   http://blog.csdn.net/zhou2002/archive/2008/01/19/2053911.aspx<br />   http://playfish.javaeye.com/blog/150184<br /><br />4,<br />python解析html<br />http://lenciel.cn/docs/python-parser-of-xml/<br />http://hi.baidu.com/javalang/blog/item/84bac4bf731fb80f18d81fe1.html<br />ruby用hpricot<br /><br /><img src ="http://www.aygfsteel.com/leekiang/aggbug/181163.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/leekiang/" target="_blank">leekiang</a> 2008-02-21 18:29 <a href="http://www.aygfsteel.com/leekiang/archive/2008/02/21/181163.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank">ɳ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ͨɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">׼</a>| <a href="http://" target="_blank">ӽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ӱ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʯ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">۽</a>| <a href="http://" target="_blank">˳</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">¡</a>| <a href="http://" target="_blank">¡</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ٷ</a>| <a href="http://" target="_blank">̨</a>| <a href="http://" target="_blank">캵</a>| <a href="http://" target="_blank">ľ</a>| <a href="http://" target="_blank">ͬ</a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>