JS导出excel表格

阅读更多
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page import="com.hisun.mvqq.bean.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.math.*"%>
<%@ page import="java.lang.*,com.hisun.res.Config"%>
<%@include file="/jsp/validate/validate.jsp"%>




<%
   String AAADBUser = Config.getProperty("AAADBUSER");   
   //MaxTime maxtime=new MaxTime();
  // String MTime=maxtime.Max_Time("ACA_BUSIDETAIL_LATN_HOUR");
   //if(MTime!=null && MTime.length()>8)
   // MTime=MTime.substring(0,4)+"-"+MTime.substring(4,6)+"-"+MTime.substring(6,8)+" "+MTime.substring(8,10)+"时";
   //if(MTime!=null)
   // MTime=MTime+"时";
%>
<%
  String sp_ID=userInfo.getSpCode();
  String sp_name=userInfo.getSpName();
  String cStatUserName=userInfo.getUserName();
 
  String querytype=request.getParameter("querytype");//以sp还是以接入号方式查询
  String prefixtype=request.getParameter("prefixtype"); //以号段方式还是多个业务方式
  String qprefix=request.getParameter("prefix");    //输入一个或多个接入号
  String prefixstart=request.getParameter("prefixstart"); //开始接入号
  String prefixend=request.getParameter("prefixend");    //结束接入号
 
 

  String cTable=sp_name;
  String spID=request.getParameter("sp");

  String busType=request.getParameter("busType");
  String callType=request.getParameter("callType");
  String statType=request.getParameter("statType");
  String userType=request.getParameter("userType");

  String sYear=request.getParameter("sYear");
  String sMonth=request.getParameter("sMonth");
  String sDay=request.getParameter("sDay");
  String sHour=request.getParameter("sHour") ;
  String sDate=sYear+"-"+sMonth+"-"+sDay+" "+sHour;
  //System.out.println(sDate);
  spStatDate sD=new spStatDate();
 
  //sDate=sD.resDate(sDate);
 

  String eYear=request.getParameter("eYear");
  String eMonth=request.getParameter("eMonth");
  String eDay=request.getParameter("eDay");
  String eHour=request.getParameter("eHour");
  String eDate=eYear+"-"+eMonth+"-"+eDay+" "+eHour;
 
  String durl="";
  //eDate=sD.resDate(eDate);
// System.out.print(eDate);
  Vector statData=new Vector();
  Vector statClass=new Vector();
   try{
       spStatMete stat=new spStatMete();
   String prefixStr="";
   if (prefixtype.equals("0"))
  prefixStr=qprefix;
   else
   prefixStr=prefixstart+","+prefixend;
 
   if (querytype.equals("1")){
       statData=stat.statMete(querytype,spID,busType,callType,statType,userType,sDate,eDate,userInfo.getLoginNo(),userInfo.getIpAddress());
durl="stYeWuLiang_ShengFen.jsp?querytype="+querytype+"&sp="+spID+"&serid="+busType+"&callType="+callType+"&statType="+statType+"&userType="+userType;
durl=durl+"&sYear="+sYear+"&sMonth="+sMonth+"&sDay="+sDay+"&sHour="+sHour;
durl=durl+"&eYear="+eYear+"&eMonth="+eMonth+"&eDay="+eDay+"&eHour="+eHour;
}  
   else{
   statData=stat.statMete(querytype,prefixtype,prefixStr,callType,statType,userType,sDate,eDate,userInfo.getLoginNo(),userInfo.getIpAddress());
   durl="stYeWuLiang_ShengFen.jsp?querytype="+querytype+"&sp="+prefixtype+"&serid="+prefixStr+"&callType="+callType+"&statType="+statType+"&userType="+userType;
durl=durl+"&sYear="+sYear+"&sMonth="+sMonth+"&sDay="+sDay+"&sHour="+sHour;
durl=durl+"&eYear="+eYear+"&eMonth="+eMonth+"&eDay="+eDay+"&eHour="+eHour;
   }
   statClass=stat.statMeteClass(spID,busType,callType,statType,userType,sDate,eDate,userInfo.getLoginNo(),userInfo.getIpAddress());
   //out.println(busType);
       if(sp_ID.equals("0001")){
          sp_name=stat.sp_Name(spID);
       }
      }catch(Exception e){
         e.printStackTrace();
     }
  GregorianCalendar createTime = new GregorianCalendar();
%>


【电信语音服务平台】







 
   
   
 
 
   
   
 
 
   
   
 
 
   
   
 

     
       
         
         
       
     
统计分析 业务量情况分析

   


        <%=sp_name%>业务量分布情况

       
         
           
           

         
       
统计分析日期:<%=sDate%><%//=sDate.substring(0,4)%><%//=sDate.substring(4,6)%><%//=sDate.substring(6,8)%> <%//=sDate.substring(8,10)%>时<%=eDate%><%//=eDate.substring(0,4)%><%//=eDate.substring(4,6)%><%//=eDate.substring(6,8)%> <%//=eDate.substring(8,10)%>时
             
             
           

              align=center bgcolor=#dddddd bordercolorlight=#dddddd border=1>
         
         
           

           
                      
           
           
            
           

           
         

          <%

//合计信息
String sername_all="合计";
int user_count_all=0;
int record_count_all=0;
//float uticket_duration_all=0.00F;
float avageTime_all=0.00F;
float billing_duration_all=0.00F;
float BILL_CHARGE_all=0.00F;
float INFO_CHARGE_all=0.00F;
float SEC_BILLING_CHARGE_all=0.00F;

//System.out.println("durl:"+durl);
   if(statData.size()>0)
  for(int i=0;i         //System.out.println("statData.size:"+i);
Hashtable hash = (Hashtable)statData.elementAt(i);
//out.print((String)hash.get("sql"));
String serid=(String)hash.get("serid");
String sername = (String)hash.get("sername");
String prefix1=(String)hash.get("prefix");
String user_count = (String)hash.get("user_count");
String record_count = (String)hash.get("record_count");
//String uticket_duration = (String)hash.get("uticket_duration");

String billing_duration = (String)hash.get("billing_duration");
String avageTime = (String)hash.get("avageTime");
String sp_id=(String)hash.get("sp_id");

String url="stYeWuLiang_ShiJian.jsp?serid="+serid+"&callType="+callType+"&statType="+statType+"&userType="+userType;
url=url+"&sYear="+sYear+"&sMonth="+sMonth+"&sDay="+sDay+"&sHour="+sHour;
url=url+"&eYear="+eYear+"&eMonth="+eMonth+"&eDay="+eDay+"&eHour="+eHour;

//String surl="stYeWuLiang_ShengFen.jsp?sp="+spID+"&serid="+serid+"&callType="+callType+"&statType="+statType+"&userType="+userType;
//String url="stYeWuLiang_DiShi.jsp?sp="+spID+"&serid="+serID+"&callType="+callType+"&statType="+statType+"&userType="+userType+"&Province_id="+Province_id;
String surl="stYeWuLiang_DiShi.jsp?serid="+serid+"&callType="+callType+"&statType="+statType+"&userType="+userType;
surl=surl+"&sYear="+sYear+"&sMonth="+sMonth+"&sDay="+sDay+"&sHour="+sHour;
surl=surl+"&eYear="+eYear+"&eMonth="+eMonth+"&eDay="+eDay+"&eHour="+eHour;
               



String BILL_CHARGE = (String)hash.get("BILL_CHARGE");
String INFO_CHARGE=(String)hash.get("INFO_CHARGE");

String SEC_BILLING_CHARGE = (String)hash.get("SEC_BILLING_CHARGE");

user_count_all=user_count_all+Integer.parseInt(user_count);
record_count_all=record_count_all+Integer.parseInt(record_count);
//uticket_duration_all=uticket_duration_all+Float.parseFloat(uticket_duration);
avageTime_all=avageTime_all+Float.parseFloat(avageTime);

//System.out.println("avageTime_all:"+avageTime_all);
billing_duration_all=billing_duration_all+Float.parseFloat(billing_duration);

//System.out.println("billing_duration_all:"+billing_duration_all);
BILL_CHARGE_all=BILL_CHARGE_all+Float.parseFloat(BILL_CHARGE);
INFO_CHARGE_all=INFO_CHARGE_all+Float.parseFloat(INFO_CHARGE);
SEC_BILLING_CHARGE_all=SEC_BILLING_CHARGE_all+Float.parseFloat(SEC_BILLING_CHARGE);
              
    %>
              

                

                
                              
                
                
                 
                

               
              
                <%
              }
                     String BILLING_DURATION_ALL = String.valueOf(String.valueOf(String.valueOf(billing_duration_all))).concat("000");
                      BILLING_DURATION_ALL = BILLING_DURATION_ALL.substring(0, BILLING_DURATION_ALL.indexOf(".") + 3);
  String BILL_CHARGE_ALL=String.valueOf(String.valueOf(String.valueOf(BILL_CHARGE_all))).concat("000");
                      BILL_CHARGE_ALL = BILL_CHARGE_ALL.substring(0, BILL_CHARGE_ALL.indexOf(".") + 3);
  String AVG_BILL_ALL="0";
  if (record_count_all!=0)
  {
  AVG_BILL_ALL=String.valueOf(String.valueOf(String.valueOf(billing_duration_all/record_count_all))).concat("000"); 
AVG_BILL_ALL=AVG_BILL_ALL.substring(0, AVG_BILL_ALL.indexOf(".") + 3);
  }

  String INFO_CHARGE_ALL=String.valueOf(String.valueOf(String.valueOf(INFO_CHARGE_all))).concat("000");
  INFO_CHARGE_ALL = INFO_CHARGE_ALL.substring(0, INFO_CHARGE_ALL.indexOf(".") + 3);
 
  String SEC_BILLING_CHARGE_ALL=String.valueOf(String.valueOf(String.valueOf(SEC_BILLING_CHARGE_all))).concat("000");
                      SEC_BILLING_CHARGE_ALL = SEC_BILLING_CHARGE_ALL.substring(0, SEC_BILLING_CHARGE_ALL.indexOf(".") + 3);
%>
              
                

                
                               
                


                
                
             
              
         
       
业务名称 业务代码 呼叫用户数 呼叫次数计费时长(分) 平均计费时长(分/次) 信息费(元) 通讯费(元) 计费费用(元) 分解数据到
<%=sername%> <%=prefix1%> <%=user_count%> <%=record_count%><%=billing_duration%> <%=avageTime%> <%=INFO_CHARGE%> <%=SEC_BILLING_CHARGE%> <%=BILL_CHARGE%> 各地市 每天
<%=sername_all%> / <%=user_count_all%> <%=record_count_all%><%=BILLING_DURATION_ALL%> <%=AVG_BILL_ALL%> <%=INFO_CHARGE_ALL%> <%=SEC_BILLING_CHARGE_ALL%> <%=BILL_CHARGE_ALL%>各地市


       

              align=center bgcolor=#dddddd bordercolorlight=#dddddd border=1>
         
         
           
           
                      
           
           
           
           
             
         
          <%
            //System.out.print("汇总");
if(statClass.size()>0){
              for(int i=0;i                Hashtable hash = (Hashtable)statClass.elementAt(i);
                String serid = (String)hash.get("sername");
                String user_count = (String)hash.get("user_count");
                String record_count = (String)hash.get("record_count");
               // String uticket_duration = (String)hash.get("uticket_duration");
                String billing_duration = (String)hash.get("billing_duration");
                String avageTime = (String)hash.get("avageTime");
//System.out.println("jsp avageTime"+avageTime);
                String BILL_CHARGE = (String)hash.get("BILL_CHARGE");
String INFO_CHARGE=(String)hash.get("INFO_CHARGE");
                String SEC_BILLING_CHARGE = (String)hash.get("SEC_BILLING_CHARGE");
                %>
         

           
           
                      
           
           
           
           

           
         
          <%
              }
            }else{
             %>
         
           
           
           
           
           
           
           
            <%----%>
           
         
          <%
            }
          %>
         
       
总计 呼叫用户数 呼叫次数计费时长(分) 平均计费时长(分/次) 信息费(元) 通讯费(元) 计费费用(元)
<%=serid%> <%=user_count%> <%=record_count%><%=billing_duration%> <%=avageTime%> <%=INFO_CHARGE%> <%=SEC_BILLING_CHARGE%> <%=BILL_CHARGE%>
0 0 0 0 0 0 0 00

       

              align=center bgcolor=#dddddd bordercolorlight=#dddddd border=1>
         
         
           
         
         
       

             
               

                 

                 

                 
               
               

                 

                 
               
             

                     
                     
                     
                     
                     
                     
                     
                     
                     
                     
                    <%if(statData.size()>0){
                      %><%
                      for(int i=0;i                        String color[]={"115,152,164","99,99,156","185,53,8","239,214,115","0,63,68","17,97,158","0,128,0","128,128,0","0,0,128","0,128,128","128,0,0" ,"128,0,128","128,128,128","192,192,192","0,255,0","255,0,255","255,0,0","0,0,255","255,255,0","0,255,255","100,0,0","200,0,0","0,100,0","0,200,0","0,0,100","0,0,200","100,100,0","100,0,100","0,100,100","200,200,0","200,0,200" ,"0,200,200","100,100,100","200,200,200","150,150,150","50,50,50","150,0,0","0,0,150","50,50,0","0,50,50"};
                          Hashtable hash = (Hashtable)statData.elementAt(i);
                        String serid = (String)hash.get("sername");
                        String user_count = (String)hash.get("user_count");
                        String labelname="pie1label"+java.lang.String.valueOf(i+1);
                        String segmentname="segment"+java.lang.String.valueOf(i+1);
                        String dataname="data"+java.lang.String.valueOf(i+1)+"series1";
                        String segmentvalue=color[i%40]+"|||";
                        %>
                       
                        <%
                      }
                    }else{
                      %>
                     
                     
                      <%
                     }%>
                   

                     
                     
                     
                     
                     
                     
                     
                     
                     
                     
                    <%if(statData.size()>0){
                      %><%
                      for(int i=0;i                        String color[]={"115,152,164","99,99,156","185,53,8","239,214,115","0,63,68","17,97,158","0,128,0","128,128,0","0,0,128","0,128,128","128,0,0" ,"128,0,128","128,128,128","192,192,192","0,255,0","255,0,255","255,0,0","0,0,255","255,255,0","0,255,255","100,0,0","200,0,0","0,100,0","0,200,0","0,0,100","0,0,200","100,100,0","100,0,100","0,100,100","200,200,0","200,0,200" ,"0,200,200","100,100,100","200,200,200","150,150,150","50,50,50","150,0,0","0,0,150","50,50,0","0,50,50"};
                        Hashtable hash = (Hashtable)statData.elementAt(i);
                        String serid = (String)hash.get("sername");
                        String record_count = (String)hash.get("record_count");
                        String labelname="pie1label"+java.lang.String.valueOf(i+1);
                        String segmentname="segment"+java.lang.String.valueOf(i+1);
                        String dataname="data"+java.lang.String.valueOf(i+1)+"series1";
                        String segmentvalue=color[i%40]+"|||";
                        %>
                       
                        <%
                      }
                    }else{
                      %>
                     
                     
                      <%
                     }%>
                   

                     
                     
                     
                     
                     
                     
                     
                     
                     
                     
                    <%if(statData.size()>0){
                      %><%
                      for(int i=0;i                        String color[]={"115,152,164","99,99,156","185,53,8","239,214,115","0,63,68","17,97,158","0,128,0","128,128,0","0,0,128","0,128,128","128,0,0" ,"128,0,128","128,128,128","192,192,192","0,255,0","255,0,255","255,0,0","0,0,255","255,255,0","0,255,255","100,0,0","200,0,0","0,100,0","0,200,0","0,0,100","0,0,200","100,100,0","100,0,100","0,100,100","200,200,0","200,0,200" ,"0,200,200","100,100,100","200,200,200","150,150,150","50,50,50","150,0,0","0,0,150","50,50,0","0,50,50"};
                        Hashtable hash = (Hashtable)statData.elementAt(i);
                        String serid = (String)hash.get("sername");
                        String labelname="pie1label"+java.lang.String.valueOf(i+1);
                        String segmentname="segment"+java.lang.String.valueOf(i+1);
                        String dataname="data"+java.lang.String.valueOf(i+1)+"series1";
                        String segmentvalue=color[i%40]+"|"+serid+"||";
                        %>
                       
                        <%
                      }
                    }else{
                      %>
                     
                     
                      <%
                     }%>
                   

                     
                     
                     
                     
                     
                     
                     
                     
                     
                     
                    <%if(statData.size()>0){
                      %><%
                      for(int i=0;i                        String color[]={"115,152,164","99,99,156","185,53,8","239,214,115","0,63,68","17,97,158","0,128,0","128,128,0","0,0,128","0,128,128","128,0,0" ,"128,0,128","128,128,128","192,192,192","0,255,0","255,0,255","255,0,0","0,0,255","255,255,0","0,255,255","100,0,0","200,0,0","0,100,0","0,200,0","0,0,100","0,0,200","100,100,0","100,0,100","0,100,100","200,200,0","200,0,200" ,"0,200,200","100,100,100","200,200,200","150,150,150","50,50,50","150,0,0","0,0,150","50,50,0","0,50,50"};
                        Hashtable hash = (Hashtable)statData.elementAt(i);
                        String serid = (String)hash.get("sername");
                        String billing_duration= (String)hash.get("billing_duration");
                        String labelname="pie1label"+java.lang.String.valueOf(i+1);
                        String segmentname="segment"+java.lang.String.valueOf(i+1);
                        String dataname="data"+java.lang.String.valueOf(i+1)+"series1";
                        String segmentvalue=color[i%40]+"|||";
                        %>
                       
                        <%
                      }
                    }else{
                      %>
                     
                     
                      <%
                     }%>
                   

                     
                     
                     
                     
                     
                     
                     
                     
                     
                     
                    <%if(statData.size()>0){
                      %><%
                      for(int i=0;i                        String color[]={"115,152,164","99,99,156","185,53,8","239,214,115","0,63,68","17,97,158","0,128,0","128,128,0","0,0,128","0,128,128","128,0,0" ,"128,0,128","128,128,128","192,192,192","0,255,0","255,0,255","255,0,0","0,0,255","255,255,0","0,255,255","100,0,0","200,0,0","0,100,0","0,200,0","0,0,100","0,0,200","100,100,0","100,0,100","0,100,100","200,200,0","200,0,200" ,"0,200,200","100,100,100","200,200,200","150,150,150","50,50,50","150,0,0","0,0,150","50,50,0","0,50,50"};
                        Hashtable hash = (Hashtable)statData.elementAt(i);
String BILL_CHARGE = (String)hash.get("BILL_CHARGE");
                        //String record_count = (String)hash.get("record_count");
                        //String uticket_duration = (String)hash.get("uticket_duration");
                        //String avageTime = (String)hash.get("avageTime");

                        String labelname="pie1label"+java.lang.String.valueOf(i+1);
                        String segmentname="segment"+java.lang.String.valueOf(i+1);
                        String dataname="data"+java.lang.String.valueOf(i+1)+"series1";
                        String segmentvalue=color[i%40]+"|||";
                        %>
                       
                        <%
                      }
                    }else{
                      %>
                     
                     
                      <%
                     }%>
                   

           

        

       
         
           
           
         
       
制表时间:
             <%=sD.nowDate()%>
           
制表人:<%=cStatUserName%>  <<%=cTable%>>

       

         
           
           
         
       
 

     



你可能感兴趣的:(Excel,JSP,电信,IE,浏览器)