jxl导出报表选择保存路径

//Excel文件名
String planTitle="salerOrder";
String fileName=DateTime.getCurrtDateTime("yyyMM")+ "-" + planTitle;

OutputStream outputStream = response.getOutputStream();//取得输出流
    // 清空输出流
        response.reset();                           
        // 定义输出类型
        response.setContentType("application/msexcel");
        // 汉字文件名
        fileName = new String(fileName.getBytes("gb2312"), "iso8859-1");

        // 设定输出文件头
        response.setHeader("Content-disposition", "attachment; filename=" + fileName + ".xls");
book= Workbook.createWorkbook(outputStream);

你可能感兴趣的:(JXL)