public void exportXLS(List data,String[] properiesName, String[] headsName, Class beanClass) throws IOException{
String fileName=getParameter("exportFileName");
downloadFile(fileName+".xls");
OutputStream out=getResponse().getOutputStream();
AbstractXlsWriter xlsw= getXlsWriter();
xlsw.init();
xlsw.setOut(out);
xlsw.setEncoding(getEncoding());
xlsw.start();
xlsw.addRow( headsName );
if (beanClass==null || Map.class.isAssignableFrom(beanClass) ){
for (int i=0,len=data.size();i<len;i++){
Map record=(Map)data.get(i);
xlsw.addRow(BeanUtils.map2Array(record,properiesName));
}
}else{
for (int i=0,len=data.size();i<len;i++){
Object record= data.get(i);
xlsw.addRow( BeanUtils.bean2Array(record,properiesName,beanClass) );
}
}
xlsw.end();
xlsw.close();
}