小魔女 发表于 2015-1-16 23:21:09

ASP网页设计ASP与电子表格EXCEL的交互操纵

ActiveServerPage技术为应用开发商提供了基于脚本的直观、快速、高效的应用开发手段,极大地提高了开发的效果。在讨论ASP的安全性问题之前,让我们来看看ASP是怎么工作的。excel|电子表格|交互HerewegoagainwithanothersampleforExcel,thistimewewillbeusingASPtocreateachart.Youall
askedmeforit,nowhereisthesolution.Thanksagainforallyournicecomments:)

Firstwesetthetypeofscript

<%@LANGUAGE="VBSCRIPT"%>

Maketheobject,andsettheobjecttoanExcelsheet

DimMyExcelChart
SetMyExcelChart=CreateObject("Excel.Sheet")

Nowletswritetherestofthescript,seethecomments

showordontshowexceltouser,TRUEorFALSE
MyExcelChart.Application.Visible=True

populatethecells
MyExcelChart.ActiveSheet.Range("B2:k2").Value=Array
("Week1","Week2","Week3","Week4","Week5","Week6","Week7","Week8","Week9","Week10")
MyExcelChart.ActiveSheet.Range("B3:k3").Value=Array
("67","87","5","9","7","45","45","54","54","10")
MyExcelChart.ActiveSheet.Range("B4:k4").Value=Array
("10","10","8","27","33","37","50","54","10","10")
MyExcelChart.ActiveSheet.Range("B5:k5").Value=Array
("23","3","86","64","60","18","5","1","36","80")
MyExcelChart.ActiveSheet.Cells(3,1).Value="InternetExplorer"
MyExcelChart.ActiveSheet.Cells(4,1).Value="Netscape"
MyExcelChart.ActiveSheet.Cells(5,1).Value="Other"

Selectthecontentsthatneedtobeinthechart
MyExcelChart.ActiveSheet.Range("b2:k5").Select

Addthechart
MyExcelChart.Charts.Add
Formatthechart,settypeofchart,shapeofthebars,showtitle,getthedataforthechart,show
datatable,showlegend
MyExcelChart.activechart.ChartType=97
MyExcelChart.activechart.BarShape=3
MyExcelChart.activechart.HasTitle=True
MyExcelChart.activechart.ChartTitle.Text="Visitorslogforeachweekshowninbrowserspercentage"
MyExcelChart.activechart.SetSourceDataMyExcelChart.Sheets("Sheet1").Range("A1:k5"),1
MyExcelChart.activechart.Location1
MyExcelChart.activechart.HasDataTable=True
MyExcelChart.activechart.DataTable.ShowLegendKey=True

Savethetheexcelsheettoexcelface
MyExcelChart.SaveAs"c:chart.xls"
%>

NowletscompletetheHTMLtags.

<HTML>
<HEAD>
<TITLE>MyExcelChart</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>

ThiscompletesyerASPpage,lookbelowforthecompletecodeofmyexcelchart.asp

<%@LANGUAGE="VBSCRIPT"%>
<%
CreateObject
SetMyExcelChart=CreateObject("Excel.Sheet")

showordontshowexceltouser,TRUEorFALSE
MyExcelChart.Application.Visible=True

populatethecells
MyExcelChart.ActiveSheet.Range("B2:k2").Value=Array
("Week1","Week2","Week3","Week4","Week5","Week6","Week7","Week8","Week9","Week10")
MyExcelChart.ActiveSheet.Range("B3:k3").Value=Array
("67","87","5","9","7","45","45","54","54","10")
MyExcelChart.ActiveSheet.Range("B4:k4").Value=Array
("10","10","8","27","33","37","50","54","10","10")
MyExcelChart.ActiveSheet.Range("B5:k5").Value=Array
("23","3","86","64","60","18","5","1","36","80")
MyExcelChart.ActiveSheet.Cells(3,1).Value="InternetExplorer"
MyExcelChart.ActiveSheet.Cells(4,1).Value="Netscape"
MyExcelChart.ActiveSheet.Cells(5,1).Value="Other"

Selectthecontentsthatneedtobeinthechart
MyExcelChart.ActiveSheet.Range("b2:k5").Select

Addthechart
MyExcelChart.Charts.Add
Formatthechart,settypeofchart,shapeofthebars,showtitle,getthedata</p>因为现在数据库都使用标准的SQL语言对数据库进行管理,所以如果是标准SQL语言,两者基本上都可以通用的。SQLServer还有更多的扩展,可以用存储过程,数据库大小无极限限制。

兰色精灵 发表于 2015-1-20 09:33:13

不能只是将它停留在纸上谈兵的程度上。

简单生活 发表于 2015-1-29 06:30:24

我们必须明确一个大方向,不要只是停留在因为学而去学,我们应有方向应有目标.

老尸 发表于 2015-2-1 16:18:41

ASP(ActiveServerPages)是Microsfot公司1996年11月推出的WEB应用程序开发技术,它既不是一种程序语言,也不是一种开发工具,而是一种技术框架,不须使用微软的产品就能编写它的代码,能产生和执行动态、交互式、高效率的站占服务器的应用程序。

爱飞 发表于 2015-2-7 08:16:09

它可通过内置的组件实现更强大的功能,如使用A-DO可以轻松地访问数据库。

海妖 发表于 2015-2-21 05:54:48

下载一个源代码,然后再下载一个VBScript帮助,在源代码中遇到不认识的函数或是其他什么程序,都可以查帮助进行解决,这样学习效率很高。

再见西城 发表于 2015-3-6 19:38:45

我想问如何掌握学习节奏(先学什么再学什么)最好详细点?

透明 发表于 2015-3-13 07:07:22

虽然ASP也有很多网络教程。但是这些都不系统。都是半路出家,只是从一个例子告诉你怎么用。不会深入讨论,更不会将没有出现在例子里的方法都一一列举出来。

仓酷云 发表于 2015-3-13 07:07:24

代码逻辑混乱,难于管理:由于ASP是脚本语言混合html编程,所以你很难看清代码的逻辑关系,并且随着程序的复杂性增加,使得代码的管理十分困难,甚至超出一个程序员所能达到的管理能力,从而造成出错或这样那样的问题。

再现理想 发表于 2015-3-13 07:07:21

虽然ASP也有很多网络教程。但是这些都不系统。都是半路出家,只是从一个例子告诉你怎么用。不会深入讨论,更不会将没有出现在例子里的方法都一一列举出来。

admin 发表于 2015-3-20 15:43:02

Session:这个存储跟客户端会话过程的数据,默认20分钟失效
页: [1]
查看完整版本: ASP网页设计ASP与电子表格EXCEL的交互操纵