* 璇曞嵎鏁翠綋鎯呭喌缁熻 excel瀵煎嚭
* @param request
* @throws IOException
* @throws WriteException
*/
public void sjztqktjExcel(HttpServletRequest request) throws IOException, WriteException {
sjfxEntity entity=new sjfxEntity();
HttpSession session = request.getSession(true);
String ksq=String.valueOf(request.getParameter("ksq"));//鑰冭瘯鏈?
String zydm=String.valueOf(request.getParameter("zydm"));//涓撲笟
String kcdm=String.valueOf(request.getParameter("kcdm"));//璇剧▼
String qxdm=String.valueOf(request.getParameter("qxdm"));//鍖哄幙
String zxzzdm=String.valueOf(request.getParameter("zxzzdm"));//鍔╁鍗曚綅
String jtdwdm=String.valueOf(request.getParameter("jtdwdm"));//闆嗕綋鍗曚綅
String kslbdm = (String)request.getSession().getAttribute("kslbdm");
String cd = String.valueOf(request.getParameter("cd"));//鑿滃崟鍚?
boolean ifpage=false;
List list = entity.selectSjztqktj(ksq, zydm, kcdm, qxdm,zxzzdm, jtdwdm, kslbdm,request,ifpage);
String title = "楂樼瓑鏁欒偛鑷鑰冭瘯璇曞嵎鏁翠綋鎯呭喌缁熻琛?;
String filename = "楂樼瓑鏁欒偛鑷鑰冭瘯璇曞嵎鏁翠綋鎯呭喌缁熻琛?;
title += "("+ksq+")";
filename += "_"+ksq+".xls";
//鏂囦欢璺緞
String filepath = request.getRealPath("/") + "download\\excel\\jsxkhzb\\";
File file = new File(filepath);
filepath = filepath + filename;
if (!file.exists()) {
file.mkdirs();
}
WritableWorkbook workbook = Workbook.createWorkbook(new File(filepath));
try {
WritableSheet sheet = workbook.createSheet(cd, 0);
sheet.setPageSetup(PageOrientation.PORTRAIT,PaperSize.A4,0,0);
sheet.getSettings().setLeftMargin(0.5);
sheet.getSettings().setRightMargin(0.5);
WritableCellFormat style = null;
style = new WritableCellFormat();
style.setAlignment(Alignment.CENTRE);
style.setVerticalAlignment(VerticalAlignment.CENTRE);
style.setBorder(Border.ALL, BorderLineStyle.THIN);
style.setBackground(Colour.WHITE);
style.setWrap(true);
WritableCellFormat style_t = null;
W
ritableFont font_t = null;
font_t = new WritableFont(WritableFont.ARIAL, 14, WritableFont.BOLD,
false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
style_t = new WritableCellFormat(font_t);
style_t.setAlignment(Alignment.CENTRE);
style_t.setVerticalAlignment(VerticalAlignment.CENTRE);
style_t.setBorder(Border.ALL, BorderLineStyle.NONE);
style_t.setBackground(Colour.VERY_LIGHT_YELLOW);
style_t.setWrap(true);
//鍚堝苟14鍒?鏍囬
sheet.mergeCells(0, 0, 14, 0);
sheet.addCell(new Label(0, 0, title, style_t));
Label label_1 = new Label(0, 1, "璇剧▼浠g爜", style);
sheet.addCell(label_1);
Label label_2 = new Label(1, 1, "璇剧▼鍚嶇О", style);
sheet.addCell(label_2);
Label label_3 = new Label(2, 1, "鎶ヨ冧汉鏁?, style);
sheet.addCell(label_3);
Label label_4 = new Label(3, 1, "瀹炶冧汉鏁?, style);
sheet.addCell(label_4);
Label label_5 = new Label(4, 1, "鍚堟牸浜烘暟", style);
sheet.addCell(label_5);
Label label_6 = new Label(5, 1, "鍚堟牸鐜?, style);
sheet.addCell(label_6);
Label label_7 = new Label(6, 1, "骞冲潎鍒?, style);
sheet.addCell(label_7);
Label label_8 = new Label(7, 1, "涓昏棰樺钩鍧囧垎", style);
sheet.addCell(label_8);
Label label_9 = new Label(8, 1, "瀹㈣棰樺钩鍧囧垎", style);
sheet.addCe