asp生成excel报表问题
在test_manager.asp中有一个按钮,点击之后到test_result.asp,程序如下
VBScript code:
<%@ Language=VBScript %>
<!-- #include File="../Conn.Asp" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
<body>
<%
id=request("action")
response.Write(id)
FilePath=Server.MapPath("test_result.xls")
Set Fso=server.createobject("scripting.filesystemobject")
If Fso.FileExists(FilePath) then
Fso.DeleteFile FilePath,true
End If
Dim xlWorkSheet
Dim xlApplication
Set xlApplication = Server.CreateObject("Excel.Application")
xlApplication.Visible = False
xlApplication.Workbooks.Add
Set xlWorksheet = xlApplication.Worksheets(1)
xlWorksheet.Cells(1,1).Value = "员工编号"
xlWorksheet.Cells(1,2).Value = "中文名"
iRow = 2
sql="select * from survey_userlist where status=1 and surveyid="&id&" order by emailaddress"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,3,1
if not rs.eof then
do while not rs.eof
xlWorksheet.Cells(iRow,1).Value=rs("emailaddress")
xlWorksheet.Cells(iRow,2).Value=rs("c_name")
相关问答:
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.WebControls
Namespace CBDAspNet.WebControls.HTML
''' <summary>
'' ......
服务器现在是。net 2.0的
我现在的项目就是asp.net mvc + linq的,现在服务器的环境配置用不了。
不知道有前辈碰到过这样的问题没。
难道服务器必须要装.net3.5 和 asp.net mvc
请前辈指点
不装你认为你要怎么 ......
本人不会asp,报错了,请大家帮忙看看。
代码如下:
<%
dim keyword_Name,keyword_YJ,keyword_RQ
if rs("QS_PASS_1_name")<>"0,0" then
keyword_Name=split(rs("QS_ ......
asp虚拟主机实现伪静态的方法:
1、 重写url参数
Step1: 建立前台文件index.asp,修改url参数形式。由于读取数据库中的记录不是专题的重点,故直接给出:
<!--#include file="config.asp" -->
&l ......
一般的asp 书籍 只介绍 asp的六大对象 但像
Set fso = CreateObject("Scripting.FileSystemObject")
这些技术 却没有见过
这些东西是asp的哪方面知识
好像有 activeXobject什么 ......