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f04tZbcEaduGBC/CMJrgy4NWMwxRDRaWlbxXTqQ/I/JZwmBHgeawVI0hG9IwC7d3SNC11OC8dwfebq7p35o+KqI/dyCDgEHAIWBGLmQXHB7EX4o7g1gif1Ng8/9TZH4k6SsvirWhVObbiGg08+6/FQ+QwINL25TGHpDJZ34trs6NpORL9zuiWOQAG1dnniTutbcUxKKwmnHzWCe935J8ntnpIP7upMxWppfYmG1eKFOYqfmMoYNqeRAzKY8SYBEitXomOzh/0Zpq44zS7Ic7iQIrxJlXTh27AbXH7/Ic5wEGBiZVIdT8ofo4ug1AhoU1TLjIQZDibhlNoV8LfuvhST7Pge3hRi+/4+/2KLrkSNv3Hm4tMczowICaclkECF3kFVfDdJNnItpn9wVqQaXL4THoHCiwG9meXbreAIFJwEIE4/Mkje2gpODgURkNScuqeagpOW7FoGX7liXRxnmNmQxzzFoXmY2Wp+q5KSYnFCK15L4FQBcUD27urK8gz/FcA23jX/xLud5dWDjeD3Asxb/t+ZiFbxgipPi+JGhvJE4lpaUQS0KapleuK6+7sXxUgCL808GCDkb93hBbPN9YtHWuONCX8yddcRCoCkyYtmNyICFLsHZFU+CcQuPELJYVAN9wj2HGAf7qPueXYCzeOVEp1XcZpb4HykyWZCa6qFtDjDxTmtKIpvx+GcTx85nB3O+SCQj5dC5TNOW9KcxZl81qM5jgMl6fKq4dI+znDLBi/93bvhBua8qwjwLOS0Kmni2LXstSabju8QcAg4BBwCDoGhIKCdtjjTRA+ltf05zeDcu/4a4rQcAg4Bh4BDwCHgEHAIOATSQKCRhhFnwyHgEHAIOAQcAg4Bh4BDYPgItNttaMT/A6weemypSMCPAAAAAElFTkSuQmCC" alt="">
});
}
}
}</span></pre>
后台处理逻辑为:
DayRecruitService的逻辑:
DayRecruitDAO后台逻辑为:
StringBuffer hql </span>= <span style="color: #0000ff">new</span><span style="color: #000000"> StringBuffer(
</span>"from DayRecruit where id in(?"<span style="color: #000000">);
String[] id </span>= ids.split(","<span style="color: #000000">);
arrList.add(id[</span>0<span style="color: #000000">]);
</span><span style="color: #0000ff">for</span>(<span style="color: #0000ff">int</span> i=0;i<id.length;i++<span style="color: #000000">){
hql.append(</span>",?"<span style="color: #000000">);
arrList.add(id[i]);
}
hql.append(</span>")"<span style="color: #000000">);
list </span>= (List<DayRecruit>) <span style="color: #0000ff">this</span>.getListByHQL(-1,-1<span style="color: #000000">,hql.toString(),</span><span style="color: #0000ff">this</span><span style="color: #000000">.toStringArray(arrList));
</span><span style="color: #0000ff">return</span><span style="color: #000000"> list;
} </span><span style="color: #0000ff">catch</span><span style="color: #000000"> (RuntimeException re) {
</span><span style="color: #008000">//</span><span style="color: #008000"> TODO: handle exception</span>
log.debug("get <a href="https://www.f2er.com/tag/Failed/" target="_blank" class="keywords">Failed</a>"<span style="color: #000000">,re);
</span><span style="color: #0000ff">throw</span><span style="color: #000000"> re;
}
}</span></pre>
其中涉及到的hql语句模板是
</span><span style="color: #008000">//</span><span style="color: #008000">log.debug("BEGIN:" + DateUtils.getStrOfDateMinute());</span>
List<?> objList =<span style="color: #000000"> query.list();
</span><span style="color: #008000">//</span><span style="color: #008000">log.debug("END:" + DateUtils.getStrOfDateMinute());</span>
<span style="color: #0000ff">return</span><span style="color: #000000"> objList;
}
</span></pre>
此处还涉及到了工具类 代码为:
<span style="color: #008000">/**<span style="color: #008000">
<span style="color: #008000">*/
<span style="color: #0000ff">public <span style="color: #0000ff">static
exportExcel(
}
</span><span style="color: #008000">/**</span><span style="color: #008000">
*
* </span><span style="color: #808080">@param</span><span style="color: #008000"> headers <a href="https://www.f2er.com/tag/biaoti/" target="_blank" class="keywords">标题</a>
* </span><span style="color: #808080">@param</span><span style="color: #008000"> dataset 数据
* </span><span style="color: #808080">@param</span><span style="color: #008000"> out
</span><span style="color: #008000">*/</span>
<span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <T> <span style="color: #0000ff">void</span> exportExcel(String[] headers,Collection<T><span style="color: #000000"> dataset,"yyyy-MM-dd"<span style="color: #000000">);
}
</span><span style="color: #008000">/**</span><span style="color: #008000">
*
* </span><span style="color: #808080">@param</span><span style="color: #008000"> headers <a href="https://www.f2er.com/tag/biaoti/" target="_blank" class="keywords">标题</a>
* </span><span style="color: #808080">@param</span><span style="color: #008000"> dataset 数据
* </span><span style="color: #808080">@param</span><span style="color: #008000"> out
* </span><span style="color: #808080">@param</span><span style="color: #008000"> pattern 日期格式
</span><span style="color: #008000">*/</span>
<span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <T> <span style="color: #0000ff">void</span> exportExcel(String[] headers,OutputStream out,String pattern) {
exportExcel(</span>0,"sheet1"<span style="color: #000000">,pattern);
}
</span><span style="color: #008000">/**</span><span style="color: #008000">
* 导出数据
* </span><span style="color: #808080">@param</span><span style="color: #008000"> colSplit 需要冻结的列数目,如果没有传0
* </span><span style="color: #808080">@param</span><span style="color: #008000"> rowSplit 需要冻结的行数目,如果没有传0
* </span><span style="color: #808080">@param</span><span style="color: #008000"> dataBeginIndex 数据从第几个字段开始导出,每一条的记录,如果没有传0
* </span><span style="color: #808080">@param</span><span style="color: #008000"> sheetName 表格名字,sheet1的<a href="https://www.f2er.com/tag/mingcheng/" target="_blank" class="keywords">名称</a>
* </span><span style="color: #808080">@param</span><span style="color: #008000"> headers <a href="https://www.f2er.com/tag/biaoti/" target="_blank" class="keywords">标题</a>
* </span><span style="color: #808080">@param</span><span style="color: #008000"> dataset 数据
* </span><span style="color: #808080">@param</span><span style="color: #008000"> out <a href="https://www.f2er.com/tag/shuchu/" target="_blank" class="keywords">输出</a>流
</span><span style="color: #008000">*/</span>
<span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <T> <span style="color: #0000ff">void</span> exportExcel(<span style="color: #0000ff">int</span> colSplit,<span style="color: #0000ff">int</span> rowSplit,<span style="color: #0000ff">int</span> dataBeginIndex,String sheetName,String[] headers,OutputStream out){
exportExcel(colSplit,rowSplit,dataBeginIndex,sheetName,</span><span style="color: #0000ff">null</span><span style="color: #000000">);
}
</span><span style="color: #008000">/**</span><span style="color: #008000">
* 这是一个通用的<a href="https://www.f2er.com/tag/fangfa/" target="_blank" class="keywords">方法</a>,利用了JAVA的反射机制,可以将放置在JAVA集合中并且符号一定条件的数据以EXCEL 的形式<a href="https://www.f2er.com/tag/shuchu/" target="_blank" class="keywords">输出</a>到指定IO设备上
* </span><span style="color: #808080">@param</span><span style="color: #008000"> <T>
*
* </span><span style="color: #808080">@param</span><span style="color: #008000"> title
* 表格<a href="https://www.f2er.com/tag/biaoti/" target="_blank" class="keywords">标题</a>名
* </span><span style="color: #808080">@param</span><span style="color: #008000"> headers
* 表格<a href="https://www.f2er.com/tag/shuxing/" target="_blank" class="keywords">属性</a>列名数组
* </span><span style="color: #808080">@param</span><span style="color: #008000"> dataset
* 1.需要<a href="https://www.f2er.com/tag/xianshi/" target="_blank" class="keywords">显示</a>的数据集合,集合中一定要放置符合javabean风格的类的对象。此<a href="https://www.f2er.com/tag/fangfa/" target="_blank" class="keywords">方法</a><a href="https://www.f2er.com/tag/zhichi/" target="_blank" class="keywords">支持</a>的 javabean<a href="https://www.f2er.com/tag/shuxing/" target="_blank" class="keywords">属性</a>的数据类型有基本数据类型及String,Date,byte[](<a href="https://www.f2er.com/tag/tupian/" target="_blank" class="keywords">图片</a>数据)
* 2.或者Map,key是string类型,value<a href="https://www.f2er.com/tag/shuxing/" target="_blank" class="keywords">属性</a>
* </span><span style="color: #808080">@param</span><span style="color: #008000"> out
* 与<a href="https://www.f2er.com/tag/shuchu/" target="_blank" class="keywords">输出</a>设备关联的流对象,可以将EXCEL文档导出到本地<a href="https://www.f2er.com/tag/wenjian/" target="_blank" class="keywords">文件</a>或者网络中
* </span><span style="color: #808080">@param</span><span style="color: #008000"> pattern
* 如果有时间数据,设定<a href="https://www.f2er.com/tag/shuchu/" target="_blank" class="keywords">输出</a>格式。默认为"yyy-MM-dd",目前不需要
</span><span style="color: #008000">*/</span><span style="color: #000000">
@SuppressWarnings(</span>"unchecked"<span style="color: #000000">)
</span><span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <T> <span style="color: #0000ff">void</span> exportExcel(<span style="color: #0000ff">int</span> colSplit,String title,String pattern) {
</span><span style="color: #008000">//</span><span style="color: #008000"> 声明一个工作薄</span>
HSSFWorkbook workbook = <span style="color: #0000ff">new</span><span style="color: #000000"> HSSFWorkbook();
String sheetName </span>= (title == <span style="color: #0000ff">null</span> || title.equals("")) ? "sheet1"<span style="color: #000000"> : title;
</span><span style="color: #008000">//</span><span style="color: #008000"> <a href="https://www.f2er.com/tag/shengcheng/" target="_blank" class="keywords">生成</a>一个表格</span>
HSSFSheet sheet =<span style="color: #000000"> workbook.createSheet(sheetName);
</span><span style="color: #0000ff">try</span><span style="color: #000000">{
</span><span style="color: #0000ff">if</span>(colSplit != 0 || rowSplit != 0<span style="color: #000000">){
sheet.createFreezePane( colSplit,colSplit,rowSplit );</span><span style="color: #008000">//</span><span style="color: #008000">冻结首行(0,1);2,1</span>
<span style="color: #000000"> }
sheet.setDefaultColumnWidth((<span style="color: #0000ff">short) 15<span style="color: #000000">);
<span style="color: #008000">//<span style="color: #008000"> 生成一个样式
HSSFCellStyle style =<span style="color: #000000"> workbook.createCellStyle();
<span style="color: #008000">//<span style="color: #008000"> 设置这些样式
<span style="color: #000000"> style.setFillForegroundColor(HSSFColor.SKY_BLUE.index);
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style.setBorderRight(HSSFCellStyle.BORDER_THIN);
style.setBorderTop(HSSFCellStyle.BORDER_THIN);
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
<span style="color: #008000">//<span style="color: #008000"> 生成一个字体
HSSFFont font =<span style="color: #000000"> workbook.createFont();
font.setColor(HSSFColor.VIOLET.index);
font.setFontHeightInPoints((<span style="color: #0000ff">short) 12<span style="color: #000000">);
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
<span style="color: #008000">//<span style="color: #008000"> 把字体应用到当前的样式
<span style="color: #000000"> style.setFont(font);
style.setWrapText(<span style="color: #0000ff">true);<span style="color: #008000">//<span style="color: #008000">设置自动换行
</span><span style="color: #008000">//</span><span style="color: #008000"> <a href="https://www.f2er.com/tag/shengcheng/" target="_blank" class="keywords">生成</a>并设置另一个样式</span>
HSSFCellStyle style2 =<span style="color: #000000"> workbook.createCellStyle();
style2.setFillForegroundColor(HSSFColor.LIGHT_YELLOW.index);
style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style2.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style2.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style2.setBorderRight(HSSFCellStyle.BORDER_THIN);
style2.setBorderTop(HSSFCellStyle.BORDER_THIN);
style2.setAlignment(HSSFCellStyle.ALIGN_CENTER);
style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
</span><span style="color: #008000">//</span><span style="color: #008000"> <a href="https://www.f2er.com/tag/shengcheng/" target="_blank" class="keywords">生成</a>另一个字体</span>
HSSFFont font2 =<span style="color: #000000"> workbook.createFont();
font2.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);
</span><span style="color: #008000">//</span><span style="color: #008000"> 把字体应用到当前的样式</span>
<span style="color: #000000"> style2.setFont(font2);
style2.setWrapText(
</span><span style="color: #008000">//</span><span style="color: #008000"> 声明一个画图的顶级管理器</span>
HSSFPatriarch patriarch =<span style="color: #000000"> sheet.createDrawingPatriarch();
</span><span style="color: #008000">//</span><span style="color: #008000"> 定义注释的大小和位置,详见文档
</span><span style="color: #008000">//</span><span style="color: #008000">HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0,(short) 4,(short) 6,5));
</span><span style="color: #008000">//</span><span style="color: #008000"> 设置注释<a href="https://www.f2er.com/tag/neirong/" target="_blank" class="keywords">内容</a>
</span><span style="color: #008000">//</span><span style="color: #008000">comment.setString(new HSSFRichTextString("可以在POI中<a href="https://www.f2er.com/tag/tianjia/" target="_blank" class="keywords">添加</a>注释!"));
</span><span style="color: #008000">//</span><span style="color: #008000"> 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该<a href="https://www.f2er.com/tag/neirong/" target="_blank" class="keywords">内容</a>.
</span><span style="color: #008000">//</span><span style="color: #008000">comment.setAuthor("leno");
</span><span style="color: #008000">//</span><span style="color: #008000"> 产生表格<a href="https://www.f2er.com/tag/biaoti/" target="_blank" class="keywords">标题</a>行</span>
HSSFRow row = sheet.createRow(0<span style="color: #000000">);
</span><span style="color: #0000ff">for</span> (<span style="color: #0000ff">short</span> i = 0; i < headers.length; i++<span style="color: #000000">) {
HSSFCell cell </span>=<span style="color: #000000"> row.createCell(i);
cell.setCellStyle(style);
HSSFRichTextString text </span>= <span style="color: #0000ff">new</span><span style="color: #000000"> HSSFRichTextString(headers[i]);
cell.setCellValue(text);
}
</span><span style="color: #008000">//</span><span style="color: #008000"> 遍历集合数据,产生数据行</span>
Iterator<T> it =<span style="color: #000000"> dataset.iterator();
</span><span style="color: #0000ff">int</span> index = 0<span style="color: #000000">;
</span><span style="color: #0000ff">while</span><span style="color: #000000"> (it.hasNext()) {
index</span>++<span style="color: #000000">;
row </span>=<span style="color: #000000"> sheet.createRow(index);
T t </span>=<span style="color: #000000"> (T) it.next();
</span><span style="color: #0000ff">if</span>(t <span style="color: #0000ff">instanceof</span><span style="color: #000000"> Class){
</span><span style="color: #008000">//</span><span style="color: #008000"> 利用反射,根据javabean<a href="https://www.f2er.com/tag/shuxing/" target="_blank" class="keywords">属性</a>的先后顺序,动态<a href="https://www.f2er.com/tag/diaoyong/" target="_blank" class="keywords">调用</a>getXxx()<a href="https://www.f2er.com/tag/fangfa/" target="_blank" class="keywords">方法</a>得到<a href="https://www.f2er.com/tag/shuxing/" target="_blank" class="keywords">属性</a>值</span>
Field[] fields =<span style="color: #000000"> t.getClass().getDeclaredFields();
</span><span style="color: #0000ff">for</span> (<span style="color: #0000ff">short</span> i = 0; i < fields.length; i++<span style="color: #000000">) {
HSSFCell cell </span>=<span style="color: #000000"> row.createCell(i);
cell.setCellStyle(style2);
Field field </span>=<span style="color: #000000"> fields[i];
String fieldName </span>=<span style="color: #000000"> field.getName();
String getMethodName </span>= "get" + fieldName.substring(0,1).toUpperCase() + fieldName.substring(1<span style="color: #000000">);
Class tCls </span>=<span style="color: #000000"> t.getClass();
Method getMethod </span>= tCls.getMethod(getMethodName,<span style="color: #0000ff">new</span><span style="color: #000000"> Class[] {});
Object value </span>= getMethod.invoke(t,<span style="color: #0000ff">new</span><span style="color: #000000"> Object[] {});
</span><span style="color: #008000">//</span><span style="color: #008000"> 判断值的类型后进行强制类型转换</span>
String textValue = <span style="color: #0000ff">null</span><span style="color: #000000">;
</span><span style="color: #0000ff">if</span> (value <span style="color: #0000ff">instanceof</span> <span style="color: #0000ff">byte</span><span style="color: #000000">[]) {
</span><span style="color: #008000">//</span><span style="color: #008000"> 有<a href="https://www.f2er.com/tag/tupian/" target="_blank" class="keywords">图片</a>时,设置行高为60px;</span>
row.setHeightInPoints(600<span style="color: #000000">);
</span><span style="color: #008000">//</span><span style="color: #008000"> 设置<a href="https://www.f2er.com/tag/tupian/" target="_blank" class="keywords">图片</a>所在列宽度为80px,注意这里单位的一个换算</span>
sheet.setColumnWidth(i,(<span style="color: #0000ff">short</span>) (35.7 * 400<span style="color: #000000">));
</span><span style="color: #008000">//</span><span style="color: #008000"> sheet.autoSizeColumn(i);</span>
<span style="color: #0000ff">byte</span>[] bsValue = (<span style="color: #0000ff">byte</span><span style="color: #000000">[]) value;
HSSFClientAnchor anchor </span>= <span style="color: #0000ff">new</span> HSSFClientAnchor(0,1023,600,i,index,(<span style="color: #0000ff">short</span>) (i+1),index+1<span style="color: #000000">);
anchor.setAnchorType(</span>2<span style="color: #000000">);
HSSFPicture pic </span>=<span style="color: #000000"> patriarch.createPicture(anchor,workbook.addPicture(bsValue,HSSFWorkbook.PICTURE_TYPE_JPEG));
pic.resize();</span><span style="color: #008000">//</span><span style="color: #008000">这句话一定不要,这是用<a href="https://www.f2er.com/tag/tupian/" target="_blank" class="keywords">图片</a>原始大小来<a href="https://www.f2er.com/tag/xianshi/" target="_blank" class="keywords">显示</a></span>
} <span style="color: #0000ff">else</span><span style="color: #000000"> {
</span><span style="color: #008000">//</span><span style="color: #008000"> 其它数据类型都当作字符串简单处理</span>
textValue =<span style="color: #000000"> value.toString();
}
</span><span style="color: #0000ff">if</span> (textValue != <span style="color: #0000ff">null</span><span style="color: #000000">){
HSSFRichTextString richString </span>= <span style="color: #0000ff">new</span><span style="color: #000000"> HSSFRichTextString(textValue);
HSSFFont font3 </span>=<span style="color: #000000"> workbook.createFont();
font3.setColor(HSSFColor.BLUE.index);
richString.applyFont(font3);
cell.setCellValue(richString);
}
}
}</span><span style="color: #0000ff">else</span> <span style="color: #0000ff">if</span>(t <span style="color: #0000ff">instanceof</span> ListOrderedMap || t <span style="color: #0000ff">instanceof</span><span style="color: #000000"> HashMap){
</span><span style="color: #008000">//</span><span style="color: #008000">HashMap<String,String> map = null;</span>
ListOrderedMap map =<span style="color: #000000"> (ListOrderedMap) t;
Iterator</span><String> keys =<span style="color: #000000"> map.keySet().iterator();
</span><span style="color: #0000ff">short</span> i = 0<span style="color: #000000">;
</span><span style="color: #0000ff">while</span><span style="color: #000000">(keys.hasNext()){
HSSFCell cell </span>=<span style="color: #000000"> row.createCell(i);
cell.setCellStyle(style2);
String keyname </span>=<span style="color: #000000"> keys.next();
</span><span style="color: #008000">//</span><span style="color: #008000">此处根据keyname<a href="https://www.f2er.com/tag/shengcheng/" target="_blank" class="keywords">生成</a><a href="https://www.f2er.com/tag/biaoti/" target="_blank" class="keywords">标题</a></span>
Object keyValue =<span style="color: #000000"> map.get(keyname);
String textValue </span>= <span style="color: #0000ff">null</span><span style="color: #000000">;
</span><span style="color: #0000ff">if</span>(keyValue <span style="color: #0000ff">instanceof</span> <span style="color: #0000ff">byte</span><span style="color: #000000">[]){
</span><span style="color: #008000">//</span><span style="color: #008000"> 有<a href="https://www.f2er.com/tag/tupian/" target="_blank" class="keywords">图片</a>时,设置行高为60px;</span>
row.setHeightInPoints(300<span style="color: #000000">);
</span><span style="color: #008000">//</span><span style="color: #008000"> 设置<a href="https://www.f2er.com/tag/tupian/" target="_blank" class="keywords">图片</a>所在列宽度为80px,(<span style="color: #0000ff">short</span>) (35.7 * 200<span style="color: #000000">));
</span><span style="color: #008000">//</span><span style="color: #008000"> sheet.autoSizeColumn(i);</span>
<span style="color: #0000ff">byte</span>[] bsValue = (<span style="color: #0000ff">byte</span><span style="color: #000000">[]) keyValue;
HSSFClientAnchor anchor </span>= <span style="color: #0000ff">new</span> HSSFClientAnchor(0,255,HSSFWorkbook.PICTURE_TYPE_JPEG));
</span><span style="color: #008000">//</span><span style="color: #008000">pic.resize();</span><span style="color: #008000">//</span><span style="color: #008000">这句话一定不要,这是用<a href="https://www.f2er.com/tag/tupian/" target="_blank" class="keywords">图片</a>原始大小来<a href="https://www.f2er.com/tag/xianshi/" target="_blank" class="keywords">显示</a></span>
}<span style="color: #0000ff">else</span><span style="color: #000000">{
textValue </span>=<span style="color: #000000"> keyValue.toString();
}
</span><span style="color: #0000ff">if</span> (textValue != <span style="color: #0000ff">null</span><span style="color: #000000">){
HSSFRichTextString richString </span>= <span style="color: #0000ff">new</span><span style="color: #000000"> HSSFRichTextString(textValue);
HSSFFont font3 </span>=<span style="color: #000000"> workbook.createFont();
font3.setColor(HSSFColor.BLUE.index);
richString.applyFont(font3);
cell.setCellValue(richString);
}
i</span>++<span style="color: #000000">;
}</span><span style="color: #008000">//</span><span style="color: #008000">end while(keys.hasNext())</span>
}<span style="color: #0000ff">else</span> <span style="color: #0000ff">if</span>(t <span style="color: #0000ff">instanceof</span><span style="color: #000000"> Object[]){
Object[] object </span>=<span style="color: #000000"> (Object[])t;
</span><span style="color: #008000">//</span><span style="color: #008000">忽略前两个id字段,之后可以作为参数传入</span>
<span style="color: #0000ff">for</span>(<span style="color: #0000ff">int</span> len = dataBeginIndex;len<object.length;len++<span style="color: #000000">){
String textValue </span>= ""<span style="color: #000000">;
</span><span style="color: #0000ff">if</span>(object[len] != <span style="color: #0000ff">null</span><span style="color: #000000">){
textValue </span>=<span style="color: #000000"> object[len].toString();
}
HSSFCell cell </span>= row.createCell(len-<span style="color: #000000">dataBeginIndex);
cell.setCellStyle(style2);
HSSFRichTextString richString </span>= <span style="color: #0000ff">new</span><span style="color: #000000"> HSSFRichTextString(textValue);
HSSFFont font3 </span>=<span style="color: #000000"> workbook.createFont();
font3.setColor(HSSFColor.BLUE.index);
richString.applyFont(font3);
cell.setCellValue(richString);
}
}
}
workbook.write(out);
out.flush();
out.close();
}</span><span style="color: #0000ff">catch</span><span style="color: #000000"> (SecurityException e) {
</span><span style="color: #008000">//</span><span style="color: #008000"> TODO Auto-generated catch block</span>
<span style="color: #000000"> e.printStackTrace();
} <span style="color: #0000ff">catch<span style="color: #000000"> (NoSuchMethodException e) {
<span style="color: #008000">//<span style="color: #008000"> TODO Auto-generated catch block
<span style="color: #000000"> e.printStackTrace();
} <span style="color: #0000ff">catch<span style="color: #000000"> (IllegalArgumentException e) {
<span style="color: #008000">//<span style="color: #008000"> TODO Auto-generated catch block
<span style="color: #000000"> e.printStackTrace();
} <span style="color: #0000ff">catch<span style="color: #000000"> (IllegalAccessException e) {
<span style="color: #008000">//<span style="color: #008000"> TODO Auto-generated catch block
<span style="color: #000000"> e.printStackTrace();
} <span style="color: #0000ff">catch<span style="color: #000000"> (InvocationTargetException e) {
<span style="color: #008000">//<span style="color: #008000"> TODO Auto-generated catch block
<span style="color: #000000"> e.printStackTrace();
} <span style="color: #0000ff">catch<span style="color: #000000"> (IOException e) {
<span style="color: #008000">//<span style="color: #008000"> TODO Auto-generated catch block
<span style="color: #000000"> e.printStackTrace();
} <span style="color: #0000ff">finally<span style="color: #000000"> {
<span style="color: #008000">//<span style="color: #008000"> 清理资源
<span style="color: #000000">
}
}
}