/**
* 导出派送失败的报表
*/
public void exportData() {
Workbook hssfWorkbook = null;
InputStream is = null;
try {
String createTime_start = this.getPara("createTime_start");
String createTime_end = this.getPara("createTime_end");
ExpressOrder model = this.getModel(ExpressOrder.class);
String fileName = "jsp/dist/module/TrackTheQuery/派送失败报表模板.xlsx";
// File file = new File(this.getRequest().getServletContext().getRealPath("/") + fileName);
File file = new File(fileName);
is = new FileInputStream(file);
if (fileName.endsWith("xlsx")){
hssfWorkbook = new XSSFWorkbook(is);//Excel 2007
}else if (fileName.endsWith("xls")){
hssfWorkbook = new HSSFWorkbook(is);//Excel 2003
}
Sheet sheet = hssfWorkbook.getSheetAt(0);
//1) 导出第一行
//第二: 获取第一行
Row row = sheet.get
poi模板导出代码
最新推荐文章于 2024-05-16 20:54:20 发布