try{
for(int i=0;i<goodsList.size();i++)
{
TGoods good=(TGoods)goodsList.get(i);
row=sheet.createRow(i+1);
row.createCell((short)0).setEncoding(HSSFCell.ENCODING_UTF_16);
row.createCell((short)0).setCellValue(good.getGoodsId());
row.createCell((short)1).setEncoding(HSSFCell.ENCODING_UTF_16);
row.createCell((short)1).setCellValue(good.getCatelogId());
row.createCell((short)2).setEncoding(HSSFCell.ENCODING_UTF_16);
row.createCell((short)2).setCellValue(good.getGoodsName());
row.createCell((short)3).setEncoding(HSSFCell.ENCODING_UTF_16);
row.createCell((short)3).setCellValue(good.getGoodsPic());
row.createCell((short)4).setEncoding(HSSFCell.ENCODING_UTF_16);
row.createCell((short)4).setCellValue(good.getGoodsShichangjia());
row.createCell((short)5).setEncoding(HSSFCell.ENCODING_UTF_16);
row.createCell((short)5).setCellValue(good.getGoodsShichangjia());
row.createCell((short)6).setEncoding(HSSFCell.ENCODING_UTF_16);
row.createCell((short)6).setCellValue(good.getHuohao());
row.createCell((short)7).setEncoding(HSSFCell.ENCODING_UTF_16);
row.createCell((short)7).setCellValue(good.getYanse());
row.createCell((short)8).setEncoding(HSSFCell.ENCODING_UTF_16);
row.createCell((short)8).setCellValue(good.getChicun());
row.createCell((short)9).setEncoding(HSSFCell.ENCODING_UTF_16);
row.createCell((short)9).setCellValue(good.getGoodsDel());
}}
catch(NullPointerException e){
e.printStackTrace();
}
String fujianPath="c:\\库存信息.xls";
try
{
FileOutputStream fileOut = new FileOutputStream(fujianPath);
wb.write(fileOut);
fileOut.close();
}
catch (Exception e)
{
e.printStackTrace();
}