日期:2011-12-15  浏览次数:20880 次

以下是ASP代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn.asp"-->
<!--#include file="adovbs.inc"-->
<!--#include file="../inc/check_login.asp"-->
<!--#include file="pagecls.asp"-->
<%CheckUserPower "100009",Session("EmpPower")%>
<%
dim deptname,empname,fyear
deptname=Trim(Request("deptname"))
empname=Trim(Request("empname"))
fyear = Trim(Request("fyear"))
if fyear = "" then
fyear = 2006
end if
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
conn.open connstr
’if deptname = "" and empname ="" then
’sql = "HD_CK_XSHZ "&fyear&""
’conn.execute(sql)
’end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>销售出库表.</title>
<link href="../style.css" rel="stylesheet" type="text/css">
<script language="javascript"> 
           function exportExcel(hd_zlb){ 
            if (typeof(EXPORT_OBJECT)!="object"){ 
 document.body.insertAdjacentHTML("afterBegin","<OBJECT style=’display:none’ classid=clsid:0002E510-0000-0000-C000-000000000046 id=EXPORT_OBJECT></Object>"); 
   } 
 with (EXPORT_OBJECT){ 
          DataType = "HTMLData"; 
          HTMLData =hd_zlb.outerHTML; 
      try{ 
           ActiveSheet.Export("C:\\华达销售出库一览表.xls", 0); 
  alert(’成功导出EXCEL表格!’); 
            } 
  catch (e){ 
               alert(’导出EXCEL表格失败,请确定已安装Excel2000(或更高版本),并且没打开同名xls文件’); 
  } 
            } 
 } 
</script> 
</head>
<body>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
<form name="form1" method="post" action="list_loading.asp">
    <tr> 
      <td><select name="fyear">
        <option value="2005" <%if fyear=2005 then response.write"selected"%>>2005年</option>
        <option value="2006" <%if fyear=2006 then response.write"selected"%>>2006年</option>
        <option value="2007" <%if fyear=2007 then response.write"selected"%>>2007年</option>