1.java导出excel报表:
package cn.jcenterhome.util;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import jxl.Workbook;
import jxl.format.Alignment;
import jxl.format.Border;
import jxl.format.BorderLineStyle;
import jxl.format.VerticalAlignment;
import jxl.write.Label;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
public class ExportExcel {
public final static String exportExcel(List header,
List> list,String xlsName,String
type,HttpServletResponse response) {
String result="系统提示:Excel文件导出成功!";
// 以下开始输出到EXCEL
try {
//定义输出流,以便打开保存对话框______________________begin
response.reset();// 清空输出流
response.setHeader("Content-disposition", "attachment;
filename="+ new String(xlsName.getBytes("GB2312"),"ISO8859-1"));
// 设定输出文件头
response.setContentType("application/octet-stream");// 定义输出类型
OutputStream os = response.getOutputStream();// 取得输出流
//定义输出流,以便打开保存对话框_______________________end
/** ****