|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
实现规模效益。与传统的用户拥有硬件软件所有权和使用权以及传统的应用服务商提供一对一的服务模式不同,ASP拥有应用系统所有权,用户拥有使用权,应用系统集中放在ASP的数据中心中,集中管理,分散使用,以一对多的租赁的形式为众多用户提供有品质保证的应用技术服务,实现规模效益。数据|网页|owc ASP经由过程OWC组件把网页数据导出EXECL文件,完成代码以下:
<%
'先要用regsvr32.exe msowc.dll注册owc组件(msowc.dll装置office2000后就有了,在office的装置目次下搜刮*owc*.chm可找到这关于owc的匡助文档)
Dim objOWC
Dim ExeclFileName
ExeclFileName = server.mappath("ExeclText.xls")
Set objOWC = Server.CreateObject("OWC.Spreadsheet")
With objOWC
.cells(1,1) = "以下数据来自企业财富[不锈钢报价买卖平台]"
.cells(1,5) = "定货号:No.2006072815350096014"
.range("a1:d1").merge()
.range("e1:g1").merge()
.range("e1:g1").HAlignment = 3
.range("a1:g1").rowHeight=14.25*1.33
.range("a1:g1").Font.Name = "宋体"
.range("a1:g1").Font.Size = 9
.range("a1:g1").VAlignment = 1
.range("a1:g1").Borders(1).weight =1 '仅显示下边框 1,2,3,4分离对应右,下,左,上四个边框(顺时针)
.range("a1:g1").Borders.Color = "Black"
.cells(2,1) = "上海精铸不锈钢成品无限公司"
.range("a2:g2").merge()
.range("a2:g2").Font.Name = "黑体"
.range("a2:g2").RowHeight = 50
.range("a2:g2").Font.Size = 14
.range("a2:g2").HAlignment = 2
.range("a2:g2").VAlignment = 1
.range("a2:g2").Font.Bold = true
.cells(3,1) = "Shang Hai Jing Zhu Bu Xiu Gang Zhi Pin You Xian Gong Si"
.cells(4,1) = "德律风:021-63609459 传真:021-63609453 地址:上海厦路径180号-3"
.range("a3:g3").merge()
.range("a4:g4").merge()
.range("a3:g3").Font.Name = "Arial"
.range("a4:g4").Font.Name = "宋体"
.range("a3:g4").Font.Size = 10
.range("a3:g4").RowHeight = 25
.range("a3:g4").HAlignment = 2
.range("a3:g4").VAlignment = 1
.cells(5,1) = "订 货 单"
.range("a5:g5").merge()
.range("a5:g5").Font.Name = "黑体"
.range("a5:g5").Font.Size = 16
.range("a5:g5").HAlignment = 2
.range("a5:g5").VAlignment = 1
.range("a5:g5").RowHeight = 30*1.33
.range("a5:g5").Font.Bold = true
.cells(6,1) = "序号"
.cells(6,2) = "产物称号"
.cells(6,3) = "产物规格"
.cells(6,4) = "单元"
.cells(6,5) = "数目"
.cells(6,6) = "单价(含税)"
.cells(6,7) = "算计"
.range("a6:g6").Font.Name = "宋体"
.range("a6:g6").Font.Size = 10
.range("a6:g6").Font.Bold = True
.range("a6:g6").VAlignment = 1
.range("a6:g6").HAlignment = 2
.range("a6:g6").RowHeight = 18 *1.33
.range("e6:g6").HAlignment = 3
For i = 1 to 5
.cells(6+i,1) = i
.cells(6+i,2) = "301A不锈钢无缝钢管"
.cells(6+i,3) = "22*2.5"
.cells(6+i,4) = "Kg"
.cells(6+i,5) = "1.00"
.cells(6+i,6) = "0.00"
.cells(6+i,7) = "0.00"
Next
.range("a7:d" & 6+i).HAlignment = 2
.range("a6:g" & 6+i+1).Borders.Weight = 1
.range("a6:g" & 6+i+1).Borders.Color = "Black"
.cells(6+i,1) = "总计:"
.range("a" & 6+i & ":d" & 6+i).merge()
.range("a" & 6+i ).HAlignment = 1
.cells(6+i,5) = "5.00"
.cells(6+i,7) = "0.00"
.cells(6+i+1,1) = "发卖金额(大写):零元零角零分"
.range("a" & 6+i+1 & ":g" & 6+i+1).merge()
.range("b6:b6").ColumnWidth = 18*10
.range("f6:f6").ColumnWidth = 7.5*10
.range("a7:g" & (6+i+2)).Font.Size = 10
.range("a7:g" & (6+i+2)).Font.Name = "宋体"
.cells(6+i+2,1) = "需方信息"
.range("a" & 6+i+2 & ":g" & 6+i+2).merge()
.range("a" & 6+i+2 & ":g" & 6+i+2).RowHeight = 20 *1.33
.range("a" & 6+i+2 & ":g" & 6+i+2).HAlignment = 2
.range("a" & 6+i+2 & ":g" & 6+i+2).VAlignment = 1
.range("a" & 6+i+2 & ":g" & 6+i+2).Font.Size = 12
.range("a" & 6+i+2 & ":g" & 6+i+2).Font.Name = "黑体"
.cells(6+i+3,1) = "单元称号:"
.cells(6+i+3,2) = "上海企购收集科技信息开展无限公司(测试数据)"
.range("b" & 6+i+3 & ":g" & 6+i+3).merge()
.range("a" & 6+i+3).HAlignment = 3
.cells(6+i+4,1) = "单元地址:"
.range("a" & 6+i+4).HAlignment = 3
.cells(6+i+4,2) = "上海闵行区莘庄水清三村49号1501室"
.range("b" & 6+i+4 & ":g" & 6+i+4).merge()
.cells(6+i+5,1) = "电 话:"
.range("a" & 6+i+5).HAlignment = 3
.cells(6+i+5,2) = "021-54172198"
.cells(6+i+5,3) = "传 真:"
.range("c" & 6+i+5).HAlignment = 3
.cells(6+i+5,4) = "021-54172196"
.range("d" & 6+i+5 & ":e" & 6+i+5).merge()
.cells(6+i+5,6) = "接洽人:"
.range("f" & 6+i+5).HAlignment = 3
.cells(6+i+5,7) = "张三"
.range("a" & 6+i+3 & ":g" & 6+i+5).Font.Name = "宋体"
.range("a" & 6+i+3 & ":g" & 6+i+5).Font.Size = 9
.range("a" & 6+i+3 & ":g" & 6+i+5).Borders.Weight=1
.range("a" & 6+i+3 & ":g" & 6+i+5).Borders.Color="Black"
.range("e7:g" & 6+i).NumberFormat = "0.00"
'偶的版权信息^_^(QQ:278919507)
.cells(6+i+6,1) = "Powered by Jimmy(菩提树下的杨过) QQ:278919507 "
.range("a" & 6+i+6 & ":g" & 6+i+6).merge()
.range("a" & 6+i+6 & ":g" & 6+i+6).HAlignment = 3
.range("a" & 6+i+6 & ":g" & 6+i+6).RowHeight = 30*1.33
.range("a" & 6+i+6 & ":g" & 6+i+6).Hyperlink.Address = "http://blog.1jq.net"
End With
call objOWC.ActiveSheet.Export(ExeclFileName,0)
Set objOWC = Nothing
Response.Write "<a href='" & ExeclFileName & "' target=_blank>" & ExeclFileName & " 生成终了</a>"
%>
使用filesystemobject,可以对服务器上的文件进行操作,浏览、复制、移动、删除等。有ado的支持,asp对数据库的操作非常得心应手。你甚至可以像使用本地数据库那样,管理远程主机上的数据库,对表格、记录进行各种操作。 |
|