/**
 * 业务员工资倒入
 * @throws CCustomException
 */
你先要查询出你得到的记录
然后:
try
{
File tempFile=new File(this.m_hsrRequest.getRealPath("")+("Files\\DownLoad\\Salary.xls"));
WritableWorkbook workbook = Workbook.createWorkbook(tempFile);
WritableSheet sheet = workbook.createSheet("业务员工资列表", 0); 

//一些临时变量,用于写到excel中
Label l=null;
jxl.write.Number n=null;
jxl.write.DateTime d=null;

//预定义的一些字体和格式,同一个Excel中最好不要有太多格式
WritableFont headerFont = new WritableFont(WritableFont.ARIAL, 12, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, jxl.format.Colour.BLUE); 
WritableCellFormat headerformat = new WritableCellFormat (headerFont); 

WritableFont titleFont = new WritableFont(WritableFont.ARIAL, 10, WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, jxl.format.Colour.RED); 
WritableCellFormat titleformat = new WritableCellFormat (titleFont); 

WritableFont detFont = new WritableFont(WritableFont.ARIAL, 10, WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, jxl.format.Colour.BLACK); 
WritableCellFormat detformat = new WritableCellFormat (detFont); 

//剩下的事情,就是用上面的内容和格式创建一些单元格,再加到sheet中
l=new Label(0, 0, "业务员工资列表", headerformat);
sheet.addCell(l);
//add Title
int column=0;
l=new Label(column++, 2, "业务员姓名", titleformat);
sheet.addCell(l);
l=new Label(column++, 2, "基本工资", titleformat);
sheet.addCell(l);
l=new Label(column++, 2, "合同金额", titleformat);
sheet.addCell(l);
l=new Label(column++, 2, "提成比率", titleformat);
sheet.addCell(l); 
l=new Label(column++, 2, "工资总数", titleformat);
sheet.addCell(l);

//add detail
for (int j = 0; j < m_listObj.size(); j++)
{                                    //这里是你得到的结果
map = (Map)m_listObj.get(i);
column=0;
l=new Label(column++, i+3,handleNull(map.get("BUSSINESSNAME")),detformat);
sheet.addCell(l);
l=new Label(column++, i+3,sDiXin , detformat);
sheet.addCell(l);
l=new Label(column++, i+3,handleNull(map.get("RESVAMOUNT")),detformat);
sheet.addCell(l);
l=new Label(column++, i+3,ShortDouble(dTicheng) , detformat);
sheet.addCell(l);
l=new Label(column++, i+3,ShortDouble(dGZ), detformat);
sheet.addCell(l);
}

workbook.write();
workbook.close();
}
catch(WriteException e)
{
throw new CCustomException("","文件读写错误","");
}
catch(IOException e)
{
throw new CCustomException("","文件读写错误","");
}
try
{
this.m_hsrResponse.sendRedirect("../../../Files/DownLoad/Salary.xls");   
}
catch(IOException e)
{
e.printStackTrace();
throw new CCustomException("","重定向出错.","");
}
}