MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » jxl读excel中数据的有关问题{全部家当酬谢}

jxl读excel中数据的有关问题{全部家当酬谢}(2)

www.MyException.Cn  网友分享于:2013-12-20  浏览:25次

sheet.addCell(new Label(3,3, "城维税 "));
sheet.addCell(new Label(4,3, "个所税 "));
sheet.addCell(new Label(5,3, "企所税 "));
sheet.addCell(new Label(6,3, "房产税 "));
sheet.addCell(new Label(7,3, "土使税 "));
sheet.addCell(new Label(8,3, "土增税 "));
sheet.addCell(new Label(9,3, "车船税 "));
sheet.addCell(new Label(10,3, "印花税 "));
sheet.addCell(new Label(11,3, "资源税 "));
sheet.addCell(new Label(12,3, "费 "));
sheet.addCell(new Label(13,3, "基金 "));
sheet.addCell(new Label(14,3, "合计 "));

if(null!=list&&list.size()> 0){
for(int i=0;i <list.size();i++){
TQA_RCJC_AJDJ_BEAN bean=(TQA_RCJC_AJDJ_BEAN) list.get(i);
sheet.addCell(new Label(0,i+4,bean.getNsrnbm()));
sheet.addCell(new Label(1,i+4,bean.getName_nsr()));
sheet.addCell(new Label(2,i+4, " "));
sheet.addCell(new Label(3,i+4, " "));
sheet.addCell(new Label(4,i+4, " "));
sheet.addCell(new Label(5,i+4, " "));
sheet.addCell(new Label(6,i+4, " "));
sheet.addCell(new Label(7,i+4, " "));
sheet.addCell(new Label(8,i+4, " "));
sheet.addCell(new Label(9,i+4, " "));
sheet.addCell(new Label(10,i+4, " "));
sheet.addCell(new Label(11,i+4, " "));
sheet.addCell(new Label(12,i+4, " "));
sheet.addCell(new Label(13,i+4, " "));
sheet.addCell(new Label(14,i+4, " "));
}
book.write();
book.close();
}else{

return;
}
}
catch (Exception e)
{
System.out.print(e.toString());
}
response.setHeader( "Cache-Control ", "no-store ");
response.setHeader( "Pragrma ", "no-cache ");
response.setDateHeader( "Expires ", 0);
response.setHeader( "Content-Type ",
"application/vnd.ms-excel;charset=ISO-8859-1 ");
response.setHeader( "Content-Disposition ", "attachment; filename=\ " "
+ fileName + "\ " ");
java.io.FileInputStream fileInputStream = new FileInputStream(path
+ "/ " + fileName);
int i;
while ((i = fileInputStream.read()) != -1)
{
out.write(i);
}
fileInputStream.close();
out.close();

}

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有