|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
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还有更多的扩展,可以用存储过程,数据库大小无极限限制。 |
|