⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yeardata.jsp

📁 java高级引用管理综合朝鲜经java高级引用管理综合朝鲜经java高级引用管理综合朝鲜经java高级引用管理综合朝鲜经
💻 JSP
📖 第 1 页 / 共 5 页
字号:
<%@ page language="java" import="java.util.*,java.io.OutputStream,com.model.*,com.download.*"
	pageEncoding="gbk"%>
	<%@ page import="org.springframework.context.ApplicationContext
,org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@ page
	import="jxl.*,jxl.format.Alignment,jxl.write.*,jxl.format.VerticalAlignment,jxl.write.WritableCellFormat"%>
<%@page import="com.hbmDAO.DeptAssesDAO"%>
<%@page import="java.text.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'download.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	</head>

	<body>
		<%
		ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
        DeptAssesDAO dao = (DeptAssesDAO)ctx.getBean("deptassesDAO");
        List<DeptAsses> datas = dao.queryByHql("from DeptAsses where asses_date like '%"+request.getParameter("year")+"%'");
        System.out.println("ggggg=="+datas.size());
			OutputStream os = response.getOutputStream();//取得输出流		    		    
			response.reset();//清空输出流
			response.setHeader("Content-disposition", "attachment; filename="
					+ new String("数据信息.xls".getBytes(), "iso-8859-1"));//设定输出文件头
			response.setContentType("application/msexcel");
    jxl.write.WritableWorkbook workbook = Workbook.createWorkbook(os); //建立excel文件
  WritableSheet sheet1 = workbook.createSheet("sheet1", 0);//创建sheet
  sheet1.mergeCells(0, 0, 0, 1);
  sheet1.mergeCells(1, 0, 2, 1);
  sheet1.mergeCells(3, 0 ,4, 1);
  sheet1.mergeCells(5, 0, 6, 1);
  sheet1.mergeCells(7, 0, 8, 1);
  sheet1.mergeCells(9, 0, 10, 1);
  sheet1.mergeCells(11, 0, 12, 1);
  sheet1.mergeCells(13, 0, 14, 1);
  sheet1.mergeCells(15, 0, 16, 1);
  sheet1.mergeCells(17, 0, 18, 1);
  sheet1.mergeCells(19, 0, 20, 1);
  sheet1.mergeCells(21, 0, 22, 1);
  sheet1.mergeCells(23, 0, 24, 1);
  sheet1.mergeCells(25, 0, 27, 1);

  sheet1.setColumnView(0, 10);
  sheet1.setColumnView(1, 6);
  sheet1.setColumnView(2, 6);
  sheet1.setColumnView(3, 6);
  sheet1.setColumnView(4, 6);
  sheet1.setColumnView(5, 6);
  sheet1.setColumnView(6, 6);
  sheet1.setColumnView(7, 6);
  sheet1.setColumnView(8, 6);
  sheet1.setColumnView(9, 6);
  sheet1.setColumnView(10, 6);
  sheet1.setColumnView(11, 6);
  sheet1.setColumnView(12, 6);
  sheet1.setColumnView(13, 6);
  sheet1.setColumnView(14, 6);
  sheet1.setColumnView(15, 6);
  sheet1.setColumnView(16, 6);
  sheet1.setColumnView(17, 7);
  sheet1.setColumnView(18, 6);
  sheet1.setColumnView(19, 6);
  sheet1.setColumnView(20, 6);
  sheet1.setColumnView(21, 6);
  sheet1.setColumnView(22, 6);
  sheet1.setColumnView(23, 6);
  sheet1.setColumnView(24, 6);
  sheet1.setColumnView(25, 6);
  sheet1.setColumnView(26, 6);
  sheet1.setColumnView(27, 6);

  
  
WritableCellFormat totalx2Format = new WritableCellFormat(); 
  



 totalx2Format.setVerticalAlignment(VerticalAlignment.CENTRE); //垂直居中 
 totalx2Format.setAlignment(Alignment.CENTRE);//水平居中
 //totalx2Format.setBackground(jxl.format.Colour.BLUE_GREY);

    sheet1.addCell(new jxl.write.Label(0, 	0, 	"   ",totalx2Format));     
    sheet1.addCell(new jxl.write.Label(0, 	2, 	"部所",totalx2Format)); 
    sheet1.addCell(new jxl.write.Label(1, 	0, 	"一月",totalx2Format)); 
    sheet1.addCell(new jxl.write.Label(1, 	2, 	"考核",totalx2Format));
    sheet1.addCell(new jxl.write.Label(2, 	2, 	"加减",totalx2Format));
    
    sheet1.addCell(new jxl.write.Label(3, 	0, 	"二月",totalx2Format)); 
    sheet1.addCell(new jxl.write.Label(3, 	2, 	"考核",totalx2Format));
    sheet1.addCell(new jxl.write.Label(4, 	2, 	"加减",totalx2Format));
     
    sheet1.addCell(new jxl.write.Label(5, 	0, 	"三月",totalx2Format)); 
    sheet1.addCell(new jxl.write.Label(5, 	2, 	"考核",totalx2Format));
    sheet1.addCell(new jxl.write.Label(6, 	2, 	"加减",totalx2Format));
    
    sheet1.addCell(new jxl.write.Label(7, 	0, 	"四月",totalx2Format)); 
    sheet1.addCell(new jxl.write.Label(7, 	2, 	"考核",totalx2Format));
    sheet1.addCell(new jxl.write.Label(8, 	2, 	"加减",totalx2Format));
    
    sheet1.addCell(new jxl.write.Label(9, 	0, 	"五月",totalx2Format)); 
    sheet1.addCell(new jxl.write.Label(9, 	2, 	"考核",totalx2Format));
    sheet1.addCell(new jxl.write.Label(10, 	2, 	"加减",totalx2Format));
    
    sheet1.addCell(new jxl.write.Label(11, 	0, 	"六月",totalx2Format)); 
    sheet1.addCell(new jxl.write.Label(11, 	2, 	"考核",totalx2Format));
    sheet1.addCell(new jxl.write.Label(12, 	2, 	"加减",totalx2Format));
    
    sheet1.addCell(new jxl.write.Label(13, 	0, 	"七月",totalx2Format)); 
    sheet1.addCell(new jxl.write.Label(13, 	2, 	"考核",totalx2Format));
    sheet1.addCell(new jxl.write.Label(14, 	2, 	"加减",totalx2Format));
    
    sheet1.addCell(new jxl.write.Label(15, 	0, 	"八月",totalx2Format)); 
    sheet1.addCell(new jxl.write.Label(15, 	2, 	"考核",totalx2Format));
    sheet1.addCell(new jxl.write.Label(16, 	2, 	"加减",totalx2Format));
    
    sheet1.addCell(new jxl.write.Label(17, 	0, 	"九月",totalx2Format)); 
    sheet1.addCell(new jxl.write.Label(17, 	2, 	"考核",totalx2Format));
    sheet1.addCell(new jxl.write.Label(18, 	2, 	"加减",totalx2Format));
    
    sheet1.addCell(new jxl.write.Label(19, 	0, 	"十月",totalx2Format)); 
    sheet1.addCell(new jxl.write.Label(19, 	2, 	"考核",totalx2Format));
    sheet1.addCell(new jxl.write.Label(20, 	2, 	"加减",totalx2Format));
    
    sheet1.addCell(new jxl.write.Label(21, 	0, 	"十一月",totalx2Format)); 
    sheet1.addCell(new jxl.write.Label(21, 	2, 	"考核",totalx2Format));
    sheet1.addCell(new jxl.write.Label(22, 	2, 	"加减",totalx2Format));
    
    sheet1.addCell(new jxl.write.Label(23, 	0, 	"十二月",totalx2Format)); 
    sheet1.addCell(new jxl.write.Label(23, 	2, 	"考核",totalx2Format));
    sheet1.addCell(new jxl.write.Label(24, 	2, 	"加减",totalx2Format));

	
	sheet1.addCell(new jxl.write.Label(25, 	0, 	"小计",totalx2Format));
	sheet1.addCell(new jxl.write.Label(25, 	2, 	"考核",totalx2Format));
	sheet1.addCell(new jxl.write.Label(26, 	2, 	"加减",totalx2Format));
	sheet1.addCell(new jxl.write.Label(27, 	2, 	"总计",totalx2Format));

		   sheet1.addCell(new jxl.write.Label(0,  3, "办公室",totalx2Format));
		   sheet1.addCell(new jxl.write.Label(0,  4, "党群工作部",totalx2Format));
		   sheet1.addCell(new jxl.write.Label(0,  5, "人事部",totalx2Format));
		   sheet1.addCell(new jxl.write.Label(0,  6, "市场经营部",totalx2Format));
		   sheet1.addCell(new jxl.write.Label(0,  7, "安全监察部",totalx2Format));
		   sheet1.addCell(new jxl.write.Label(0,  8, "生产技术部",totalx2Format));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -