易截截图软件、单文件、免安装、纯绿色、仅160KB

asp导出excel二

<!--#include file=common.asp-->
<%
'**********************************************
' code by asp导出excel通用
' 修改引用 by 子言(jastudio)
' qq:23638564 email:kpggdf@163.com
' web:www.gdsspt.com
'**********************************************
dim xibua
dim mysql
xibua = request.querystring("ids")
if xibua="all" then
mysql = "select * from singup"
else
mysql = "select * from singup where [系部]='"&xibua&"'"
end if
server.scripttimeout=100000 '处理时间较长,设置值应大一点
on error resume next
set objexcelapp = createobject("excel.application")
objexcelapp.displayalerts = false
objexcelapp.application.visible = false
objexcelapp.workbooks.add
set objexcelbook = objexcelapp.activeworkbook
set objexcelsheets = objexcelbook.worksheets
set objspreadsheet = objexcelbook.sheets(1)
dim objrs
set objrs = server.createobject("adodb.recordset")
objrs.open mysql,conn,1,3
if objrs.eof then
response.write("error")
respose.end
end if
dim objfield, icol, irow
icol = 1 '取得列号
irow = 1 '取得行号
objspreadsheet.cells(irow, icol).value = ""&xibua&"部的报名情况" '单元格插入数据
objspreadsheet.columns(icol).shrinktofit=true '设定是否自动适应表格单元大小(单元格宽不变)
'设置excel表里的字体
objspreadsheet.cells(irow, icol).font.bold = true '单元格字体加粗
objspreadsheet.cells(irow, icol).font.italic = false '单元格字体倾斜
objspreadsheet.cells(irow, icol).font.size = 20 '设置单元格字号
objspreadsheet.cells(irow, icol).paragraphformat.alignment=1 '设置单元格对齐格式:居中
objspreadsheet.cells(irow,icol).font.name="宋体" '设置单元格字体
objspreadsheet.cells(irow,icol).font.colorindex=2 '设置单元格文字的颜色,颜色可以查询,2为白色
objspreadsheet.range("a1:f1").merge '合并单元格(单元区域)
objspreadsheet.range("a1:f1").interior.colorindex = 1 '设计单元络背景色
'objspreadsheet.range("a2:f2").wraptext=true '设置字符回卷(自动换行)
irow=irow+1
for each objfield in objrs.fields
'objspreadsheet.columns(icol).shrink


相关文档:

ASP与ActiveX控件交互实战(一)

ASP与ActiveX控件交互实战(一)  
   
  关键字:ASP,ActiveX控件,数字签名,安全    
   
  ActiveX控件运行在客户端。我们可以获得客户端的一些信息,如IC卡的信息,客户端的验证等等。但是ActiveX控件也有许多缺点:客户端的部署很困难,如客户端不能正确下载,下载了 ......

asp分页代码

 <%'开始分页
    Const MaxPerPage=25
       dim totalPut  
       dim CurrentPage
       dim TotalPages
       dim j
     ......

ASP编程中20个非常有用的例子

ASP编程中20个非常有用的例子  
 
 
1.如何用Asp判断你的网站的虚拟物理路径
答:使用Mappath方法
<%= Server.MapPath("\")%>
2.我如何知道使用者所用的浏览器?
答:使用the Request object方法
strBrowser=Request.ServerVariables("HTTP_USER_AGENT")
If Instr(strBrowser,"MSIE") & ......

ASP中Split函数的实例

大家有碰到过要想取一字符串里的某些值而无从下手?有没有觉得看书或教材对split的写法糊里糊涂……如果有此疑问的话,请看下面我对例子的解释,相信您会对这个有一定的了解。
我先介绍一下Split函数的用法:
返回值数组 = Split("字符串","分割符")
假设变量strURL保存着URL值,如strURL = "ftp://username ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号