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

📄 export_operation_count_execl.jsp

📁 电信的网厅的整站代码
💻 JSP
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" contentType="text/html; charset=GBK" %>
<%@ page import="com.doone.data.*"%>
<%@ page import="com.doone.util.*"%>
<%@ page import="com.doone.uurm.*"%>
<%@ page import="com.doone.fj1w.fjmgr.statana.*"%>
<%!
	   String getHTMLString(String tmp) {
		tmp = tmp.replaceAll("\'","&#39;");
		tmp = tmp.replaceAll("\"", "&#34;");
		tmp = tmp.replaceAll("<", "&lt;");
		tmp = tmp.replaceAll(">", "&gt;");
		tmp = tmp.replaceAll("&", "&amp;");

		return tmp;
	}
	
	//String itemvalue="";
    String sllx="";
    String slzt="";
	String ywlx="";
	String start="";
	String end="";
	String citystr="";
	String area="";
	String month="";
	String week="";
	String quarter="";
	String xun="";
	String rq="";
	String year="";
	String falg="";
	String  _year="";
    String  _popedom="";
    String  _transact="";
    String  _month="";
    String  _start="";
    String  _end="";
    String  _quarter="";
    String  _xun="";
    String  _rq="";
    String  mode="";
	DataTable dt=new DataTable();
	ywsl_count ywsl_count=new ywsl_count();
	DataRow dr = null;
	
	
%>

<%
	WebAuth auth = WebAuth.getInstance(request);
	
    if ( ! auth.IsAuthed() ) {
	    out.write("<script language=\"javascript\">self.parent.location.replace(\"" + request.getContextPath() + "/view/login/login.jsp" + "\");</script>");
	    return;
    }
    
  %>
<%  

     ywlx=request.getParameter("ywlx");
     sllx=request.getParameter("sllx");
     slzt=request.getParameter("slzt");
	 quarter=request.getParameter("quarter");
	 start=request.getParameter("starttime");
     end=request.getParameter("endtime");
     xun=request.getParameter("xun");
     week=request.getParameter("week");
     rq=request.getParameter("rq");
     year=request.getParameter("year");
     citystr=request.getParameter("City");
     month=request.getParameter("month");
     String pageNo=request.getParameter("PageNo");
	 if(pageNo==null || pageNo=="")pageNo="1";
     if(year==null||year.equals("")||year.equals("null")){year="";}
     if(sllx==null||sllx.equals("null")||sllx.equals("")){sllx="";}
     if(slzt==null||slzt.equals("null")||slzt.equals("")){slzt="";}
     if(ywlx==null||ywlx.equals("null")||ywlx.equals("")){ywlx="";}
     if(start==null||start.equals("null")||start.equals("")){start="";}
     if(end==null||end.equals("null")||end.equals("")){end="";}
     if(quarter==null||quarter.equals("")||quarter.equals("null")){quarter="";}
     if(xun==null||xun.equals("")||xun.equals("null")){xun="";}
     if(rq==null||rq.equals("")||rq.equals("null")){rq="";}
 %>
<%
    
     try{
	   dt=ywsl_count.getareaCount(citystr,area,ywlx,sllx,slzt,year,quarter,month,xun,week,rq,start,end,pageNo,falg);}
	   catch(Exception ex){ex.printStackTrace();
	   }
     
     %> 
 <%

	   
	   
	StringBuffer buffer = new StringBuffer();
	
    if(!year.equals("")){_year=year+"年";}
    if(!quarter.equals("")){_quarter="第"+quarter+"季度";}
    if(!month.equals("")){_month="第"+month+"月";}
    if(!xun.equals("")){
    if(xun.equals("1")){_xun="上旬";}
    if(xun.equals("2")){_xun="中旬";}
    if(xun.equals("3")){_xun="下旬";}
    }
    if(!rq.equals("")){_rq=rq.substring(0,4)+"年"+rq.substring(5,7)+"月"+rq.substring(8,10)+"日";}
    if(!start.equals("")){_start=start+"--";}
    if(!end.equals("")){_end=end;}
    mode=_year+_quarter+_month+_xun+_rq+_start+_end;	
	
	
	
	try {
		    StringBuffer content = new StringBuffer();
			
			content.append("<ss:Row>\n");
			content.append("<ss:Cell ss:StyleID=\"wc0CEFE34C\"><ss:Data ss:Type=\"String\">地市</ss:Data>\n</ss:Cell>\n");
			content.append("<ss:Cell ss:StyleID=\"wc0CEFE34C\"><ss:Data ss:Type=\"String\">区域</ss:Data>\n</ss:Cell>\n");
			content.append("<ss:Cell ss:StyleID=\"wc0CEFE34C\"><ss:Data ss:Type=\"String\">业务类型</ss:Data>\n</ss:Cell>\n");
			content.append("<ss:Cell ss:StyleID=\"wc0CEFE34C\"><ss:Data ss:Type=\"String\">受理类型</ss:Data>\n</ss:Cell>\n");
			content.append("<ss:Cell ss:StyleID=\"wc0CEFE34C\"><ss:Data ss:Type=\"String\">受理状态</ss:Data>\n</ss:Cell>\n");
			content.append("<ss:Cell ss:StyleID=\"wc0CEFE34C\"><ss:Data ss:Type=\"String\">数量</ss:Data>\n</ss:Cell>\n");
			content.append("<ss:Cell ss:StyleID=\"wc0CEFE34C\"><ss:Data ss:Type=\"String\">统计时间</ss:Data>\n</ss:Cell>\n");
			content.append("</ss:Row>\n");
			
		 



	
		int   index = 0;
		while ( index < dt.getRows().getCount() ) {
			content.append("<ss:Row>\n");
				
			// 地市
			content.append("<ss:Cell><ss:Data ss:Type=\"String\">");
			content.append(dt.getRow(index).getString("cityname"));
			content.append("</ss:Data></ss:Cell>\n");
				
			// 区域
			content.append("<ss:Cell><ss:Data ss:Type=\"String\">");
			content.append(getHTMLString(dt.getRow(index).getString("AREANAME")));
			content.append("</ss:Data></ss:Cell>\n");

			// 业务类型
			content.append("<ss:Cell><ss:Data ss:Type=\"String\">");
			content.append(getHTMLString(dt.getRow(index).getString("ESP")));
			content.append("</ss:Data></ss:Cell>\n");
			
				
			//受理类型
			String type=dt.getRow(index).getString("type");
			if(type.equals("N")){content.append("<ss:Cell><ss:Data ss:Type=\"String\">");content.append("新装");content.append("</ss:Data></ss:Cell>\n");}
    	    else if(type.equals("A")){content.append("<ss:Cell><ss:Data ss:Type=\"String\">");content.append("新加");content.append("</ss:Data></ss:Cell>\n");}
    		else if(type.equals("S")){content.append("<ss:Cell><ss:Data ss:Type=\"String\">");content.append("纯装");content.append("</ss:Data></ss:Cell>\n");}
    		else if(type.equals("M")){content.append("<ss:Cell><ss:Data ss:Type=\"String\">");content.append("移机");content.append("</ss:Data></ss:Cell>\n");}
    		else if(type.equals("D")){content.append("<ss:Cell><ss:Data ss:Type=\"String\">");content.append("宽带变速");content.append("</ss:Data></ss:Cell>\n");}
    		else if(type.equals("C")){content.append("<ss:Cell><ss:Data ss:Type=\"String\">");content.append("关机");content.append("</ss:Data></ss:Cell>\n");}
    		else if(type.equals("0")){content.append("<ss:Cell><ss:Data ss:Type=\"String\">");content.append("开机/复机");content.append("</ss:Data></ss:Cell>\n");}
    		else{content.append("<ss:Cell><ss:Data ss:Type=\"String\">");content.append(" ");content.append("</ss:Data></ss:Cell>\n");}
    	
			
		    //受理状态
			content.append("<ss:Cell><ss:Data ss:Type=\"String\">");
			content.append(getHTMLString(dt.getRow(index).getString("state")));
			content.append("</ss:Data></ss:Cell>\n");
			
			//数量
			content.append("<ss:Cell><ss:Data ss:Type=\"String\">");
			content.append(dt.getRow(index).getString("CNT"));
			content.append("</ss:Data></ss:Cell>\n");
			
			
			//统计时间
			content.append("<ss:Cell><ss:Data ss:Type=\"String\">");
			content.append(mode);
			content.append("</ss:Data></ss:Cell>\n");
			content.append("</ss:Row>\n");
			index++;
		}

		buffer.append("<?xml version=\"1.0\"?>\n");
		buffer.append("<ss:Workbook xmlns:x=\"urn:schemas-microsoft-com:office:excel\"\n xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\"\n xmlns:c=\"urn:schemas-microsoft-com:office:component:spreadsheet\">\n ");
		buffer.append("<x:ExcelWorkbook>\n");
		buffer.append("<x:ProtectStructure>False</x:ProtectStructure>\n");
		buffer.append("<x:ActiveSheet>0</x:ActiveSheet>\n");
		buffer.append("</x:ExcelWorkbook>\n");

		buffer.append("<ss:Styles>\n");
		buffer.append("<ss:Style ss:ID=\"Default\">\n ");
		buffer.append("<ss:Alignment ss:Horizontal=\"Automatic\" ss:Rotate=\"0.0\" ss:Vertical=\"Bottom\"\n ss:ReadingOrder=\"Context\"/>\n");
		buffer.append("<ss:Borders>\n</ss:Borders>\n");
		buffer.append("<ss:Font ss:FontName=\"宋体\" ss:Size=\"10\" ss:Color=\"Automatic\" ss:Bold=\"0\"\n    ss:Italic=\"0\" ss:Underline=\"None\"/>\n");
		buffer.append("<ss:Interior ss:Color=\"Automatic\" ss:Pattern=\"None\"/>\n");
		buffer.append("<ss:NumberFormat ss:Format=\"General\"/>\n");
		buffer.append("<ss:Protection ss:Protected=\"1\"/>\n");
		buffer.append("</ss:Style>\n");
		
		buffer.append("<ss:Style ss:ID=\"wc0CEFE34C\">\n");
		buffer.append("<ss:Alignment ss:Horizontal=\"Center\"/>\n");
		buffer.append("<ss:Font ss:FontName=\"宋体\" ss:Size=\"10\" ss:Bold=\"1\"/>\n");
		buffer.append("</ss:Style>\n");

		buffer.append("</ss:Styles>\n ");
		
		
		buffer.append("<c:ComponentOptions>\n");
		buffer.append("<c:Label>\n");
		buffer.append("<c:Caption>Microsoft Office Spreadsheet</c:Caption>\n");
		buffer.append("</c:Label>\n  ");
		buffer.append("<c:MaxHeight>80%</c:MaxHeight>\n  ");
		buffer.append("<c:MaxWidth>80%</c:MaxWidth>\n  ");
		buffer.append("<c:NextSheetNumber>4</c:NextSheetNumber>\n ");
		buffer.append("</c:ComponentOptions>\n ");
		buffer.append("<x:WorkbookOptions>\n  ");
		buffer.append("<c:OWCVersion>10.0.0.4109</c:OWCVersion>\n");
		buffer.append("<x:Height>7620</x:Height>\n");
		buffer.append("<x:Width>15240</x:Width>\n");
		buffer.append("</x:WorkbookOptions>\n");
		buffer.append("<ss:Worksheet ss:Name=\"工作表\">\n  ");
		buffer.append("<x:WorksheetOptions>\n   ");
		buffer.append("<x:Selected/>\n   ");
		buffer.append("<x:ViewableRange>R1:R262144</x:ViewableRange>\n   ");
		buffer.append("<x:Selection>R1C1</x:Selection>\n   ");
		buffer.append("<x:TopRowVisible>0</x:TopRowVisible>\n ");  
		buffer.append("<x:LeftColumnVisible>0</x:LeftColumnVisible>\n   ");
		buffer.append("<x:ProtectContents>False</x:ProtectContents>\n  ");
		buffer.append("</x:WorksheetOptions>\n  ");
		buffer.append("<c:WorksheetOptions>\n  </c:WorksheetOptions>\n  ");
		buffer.append("<ss:Table ss:DefaultColumnWidth=\"54.0\" ss:DefaultRowHeight=\"12.75\">");
		
		buffer.append("<ss:Column ss:Width=\"54.0\" ss:AutoFitWidth=\"0\"/>");
		buffer.append("<ss:Column ss:Width=\"120.0\" ss:AutoFitWidth=\"0\"/>");
		buffer.append("<ss:Column ss:Width=\"54.0\" ss:AutoFitWidth=\"0\"/>");
		buffer.append("<ss:Column ss:Width=\"100.0\" ss:AutoFitWidth=\"0\"/>");
		buffer.append("<ss:Column ss:Width=\"250.0\" ss:AutoFitWidth=\"0\"/>");
		
		buffer.append(content);
		
		buffer.append("</ss:Table>\n</ss:Worksheet>\n");
		buffer.append("</ss:Workbook>\n");

		ExtString.replace(buffer, "&", "&amp;");
		ExtString.replace(buffer, "<", "&lt;");
		ExtString.replace(buffer, ">", "&gt;");
		ExtString.replace(buffer, "\"", "&quot;");
		
		//response.reset();
		//response.setContentType("application/vnd.ms-excel; charset=gbk");

		//out.print(buffer);
		//out.close();
		//return ;
	}
	catch(Exception ex){
		FileLogger.getLogger().warn(ex.getMessage(),ex);
	}
%>
<html>
<head>
    <meta content="text/html; charset=GB18030" http-equiv="content-type"/>
    <title>业务受理量统计导出EXCEL</title>
</head>
<body style="margin: 0px">
	<object width="100%" height="100%" classid="CLSID:0002E551-0000-0000-C000-000000000046" codebase="/manager/owc11.exe">
		<param name="DataType" value="XMLDATA">
		<param name="XMLData" value="<%= buffer%>">
		<table width='100%' cellpadding='0' cellspacing='0' border='0' height='8'>
			<tr>
				<td bgColor='#336699' height='25' width='10%'>&nbsp;</td>
				<td bgColor='#666666'width='85%'>
					<font face='宋体' color='white' size='4'>
						<b>&nbsp; 缺少 Microsoft Office Web Components</b>
					</font>
				</td>
			</tr>
			<tr>
				<td bgColor='#cccccc' width='15'>&nbsp;</td>
				<td bgColor='#cccccc' width='500px'><br> 
					<font face='宋体' size='2'>此网页要求 Microsoft Office Web Components。
					<p align='center'> 一般装完Office后会自动安装该组件.</p></font><p><font face='宋体' size='2'>此网页同时要求 Microsoft Internet Explorer 5.01 或更高版本。</p><p align='center'><a href='http://www.microsoft.com/windows/ie/default.htm'> 单击此处安装最新的 Internet Explorer</a>.</font><br>&nbsp;</td></tr></table>
	</object>

</body>

</html>

⌨️ 快捷键说明

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