计算机应用 | 古代文学 | 市场营销 | 生命科学 | 交通物流 | 财务管理 | 历史学 | 毕业 | 哲学 | 政治 | 财税 | 经济 | 金融 | 审计 | 法学 | 护理学 | 国际经济与贸易
计算机软件 | 新闻传播 | 电子商务 | 土木工程 | 临床医学 | 旅游管理 | 建筑学 | 文学 | 化学 | 数学 | 物理 | 地理 | 理工 | 生命 | 文化 | 企业管理 | 电子信息工程
计算机网络 | 语言文学 | 信息安全 | 工程力学 | 工商管理 | 经济管理 | 计算机 | 机电 | 材料 | 医学 | 药学 | 会计 | 硕士 | 法律 | MBA
现当代文学 | 英美文学 | 通讯工程 | 网络工程 | 行政管理 | 公共管理 | 自动化 | 艺术 | 音乐 | 舞蹈 | 美术 | 本科 | 教育 | 英语 |

ASP客户关系管理系统(一)毕业论文(6)

2013-05-29 01:14
导读:l")'把参数传给下载页面 % 当数据处理页处理完毕之后,会自动转向下载页,在下载页中单击左键,直接用web打开Excel, 右键单击“下载”选择“目标另存为
l")'把参数传给下载页面
%>
 当数据处理页处理完毕之后,会自动转向下载页,在下载页中单击左键,直接用web打开Excel, 右键单击“下载”选择“目标另存为...”把Excel保存在相应的路径下。处理Excel的页面代码如下:
<%
if request("tt")="excul" then          '当为客户报表查询时产生相应字段
 a=array("公司名称","所在国家/地区","所在城市","公司电话","公司传真","E-mail")
elseif  request("tt")="excul_l" then    '当为联系人报表查询时产生相应字段
 a=array("姓名","客户名称","部门","职务","电话","手机","E-mail")
elseif request("tt")="excul_k" then     '当为反馈客户报表查询时产生相应字段
 a=array("客户名称","反馈日期","是否解决","反馈主题","反馈内容","处理结果")
elseif request("tt")="excul_kc" then    '当为库存报表查询时产生相应字段
 a=array("客户编号","客户名称","产品数量","单位","库存类型")
end if
%>
<%response.ContentType="application/vnd.ms-excel"%>
<%
set rs=conn.execute(request("sql"))
%>
<table width="100"  border="1" cellspacing="0">
  <tr>
<%
for i=0 to rs.fields.count-1
%>
    <td align="center"><%=a(i)%></td>
<%next%>
  </tr>
<%do while not rs.eof%>
  <tr>
 <%for i=0 to rs.fields.count-1%>
    <td align="center" class="table"><%=rs(i)%></td>
 <%next%>
  </tr>
<%
rs.movenext
loop
rs.close
%>
 报表下载页面的运行结果如图24所示。

图24  报表下载页面的运行结果

(转载自中国科教评价网www.nseac.com )

 3.用web打印
 用户在查询部分输入查询条件后,单击【打印报表】按钮,用户添加的查询条件将被提交给数据处理页,处理页用select case判断隐藏域的值,进而确定怎样处理。
 数据处理页对查询条件经过处理,产生相应的SQL查询语句。程序代码如下:
<%
sql="id is not null"
if request("ClientCountry")<>"全部" then'国家/地区不为全部时
 sql=sql&" and ClientCountry='"&request("ClientCountry")&"'"
end if
if request("ClientCity")<>"全部" then   '城市不为全部时
 sql=sql&"  and ClientCity='"&request("ClientCity")&"'"
end if
if request("SetName")<>"全部" then      '客户名称不为全部时
 sql=sql&" and SetName='"&request("SetName")&"'"
end if
if trim(request("search"))<>"" then     '当关键字不为空时
 sql=sql&" and "&request("searchtype")&" like '%"&request("search")&"%'"
end if
sql="select * from tb_Client where "&sql
response.Redirect("Table_print_p.asp?sql="&sql)'把参数传给打印页面
%>
 当数据处理页处理完毕之后,会自动转向打印页,打印页是一个框架集,包含三个页面。框架页代码如下:
<%
sql=request("sql")
if sql="" then
 sql=session("sql")
end if
session("sql")=sql
show=request("show")
if show="" then
 show=15
end if
p=request("p")
if p="" or p=0 then
 p=1
end if
%>
<frameset rows="42,*" framespacing="0" frameborder="NO" border="0">
  <frame src="Table_print_top.asp?sql=<%=request("sql")%>&show=<%=show%>&p=<%=p%>" name="topFrame" frameborder="no" scrolling="NO" noresize>
(科教作文网http://zw.ΝsΕAc.Com编辑整理)

  <frame src="Table_print.asp?sql=<%=request("sql")%>&show=<%=show%>&p=<%=p%>" name="mainFrame" frameborder="no">
</frameset><noframes></noframes>
</frames>
 控制页面代码如下:
<%
sql=request("sql")'获取sql语句
上一篇:《企业人事信息管理系统》(一)毕业论文 下一篇:ASP同学录设计asp+sql(一)毕业论文