|
|
|
|
@ -8,10 +8,10 @@ import org.apache.poi.ss.usermodel.Cell;
|
|
|
|
|
import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
|
|
import org.apache.poi.ss.usermodel.FillPatternType;
|
|
|
|
|
import org.apache.poi.ss.usermodel.IndexedColors;
|
|
|
|
|
import sun.misc.BASE64Encoder;
|
|
|
|
|
//import sun.misc.BASE64Encoder;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
|
//import java.net.URLEncoder;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
@ -59,7 +59,7 @@ public class SalaryExportUtil {
|
|
|
|
|
String agent=request.getHeader("user-agent");
|
|
|
|
|
String filename=sheetName+".xls";
|
|
|
|
|
//不同浏览器需要对文件名做特殊处理
|
|
|
|
|
if (agent.contains("Firefox")) { // 火狐浏览器
|
|
|
|
|
/* if (agent.contains("Firefox")) { // 火狐浏览器
|
|
|
|
|
filename = "=?UTF-8?B?"
|
|
|
|
|
+ new BASE64Encoder().encode(filename.getBytes("utf-8"))
|
|
|
|
|
+ "?=";
|
|
|
|
|
@ -67,7 +67,7 @@ public class SalaryExportUtil {
|
|
|
|
|
} else { // IE及其他浏览器
|
|
|
|
|
filename = URLEncoder.encode(filename, "utf-8");
|
|
|
|
|
filename = filename.replace("+"," ");
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
//推送浏览器
|
|
|
|
|
response.setHeader("Content-Disposition","attachment;filename="+filename);
|
|
|
|
|
hssfWorkbook.write(response.getOutputStream());
|
|
|
|
|
|