본문 바로가기
이카루스의 날개/JSP

엑셀 떨구기

by 윙혼 2007. 1. 29.
<%@ page contentType="text/html; charset=euc-kr" %>
<%@ page import="java.net.*" %>
<%@ page import="java.util.*" %>
<%@ page import="kr.go.koreapost.mem.*" %>

<%
 // 브라우저, 프락시서버가 케시 불가능 설정
 response.setDateHeader("Expires", 0);  
 response.setHeader("Cache-Control","no-cache");
 response.setContentType("application/vnd.ms-excel");
 response.setHeader("Content-Disposition", "inline; filename=result.xls");
 response.setHeader("Content-Description", "JSP Generated Data");
%>

<jsp:useBean id="member" class="kr.go.koreapost.mem.Member" scope="page"/>
<jsp:useBean id="memberCon" class="kr.go.koreapost.mem.MemberProcess" scope="page"/>
<jsp:useBean id="Util"    class="kr.go.koreapost.util.Util" scope="page"/>
<html>
 <head></head>
 <body>
  <table>
<%
 String mail = Util.mInit(request.getParameter("m_interest"),"");
 String sYear = Util.mInit(request.getParameter("sYear"),"");
 String sMonth = Util.mInit(request.getParameter("sMonth"),"");
 String sDay = Util.mInit(request.getParameter("sDay"),"");
 String eYear = Util.mInit(request.getParameter("eYear"),"");
 String eMonth = Util.mInit(request.getParameter("eMonth"),"");
 String eDay = Util.mInit(request.getParameter("eDay"),"");
 String sDate = "";
 String eDate = "";

 Vector vc = null;

 if(!"".equals(sYear) && !"".equals(sMonth) && !"".equals(sDay) && !"".equals(eYear) && !"".equals(eMonth) && !"".equals(eDay)){
  sDate = sYear +"/"+ sMonth +"/"+ sDay;
  eDate = eYear +"/"+ eMonth +"/"+ eDay;
  vc = memberCon.getMailMember(sDate, eDate, mail);
 }else if(!"".equals(sYear) && !"".equals(sMonth) && !"".equals(sDay)){
  sDate = sYear +"/"+ sMonth +"/"+ sDay;
  vc = memberCon.getMailMember(sDate, mail);
 }else if(!"".equals(eYear) && !"".equals(eMonth) && !"".equals(eDay)){
  eDate = eYear +"/"+ eMonth +"/"+ eDay;
  vc = memberCon.getMailMember(eDate, mail, 1);
 }else
  vc = memberCon.getMailMember(mail);
 int k = vc.size();
 for(int i=0;i<k;i++){
  member = (Member)vc.get(i);
%>
   <tr>
     <td align='center' bgcolor="#EEF&FF" style='mso-number-format:"\@";'><%=member.getM_Name()%></td>
     <td align='center' bgcolor="#EEF&FF" style='mso-number-format:"\@";'><%=member.getM_Id()%></td>
     <td align='center' bgcolor="#EEF&FF" style='mso-number-format:"\@";'><%=member.getM_Email()%></td>
   </tr>
<%  
 }
%>
  </table>
 </body>
</html>


댓글