|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
SQLServer是基于服务器端的中型的数据库,可以适合大容量数据的应用,在功能上管理上也要比Access要强得多。在处理海量数据的效率,后台开发的灵活性,可扩展性等方面强大。word|打印挪用Word打印...
运转以下的剧本必要将IE的平安级别设为低,或在中级平安级别下将谁人ActiveX控件设为启用,别健忘了:
<html>
<head>
<title>BuildDocumentbyScript</TITLE>
</HEAD>
<Tableid="myData"border=1align=center>
<Tralign=center>
<Td>产物称号</Td>
<Td>产物形貌</Td>
<Td>产物单价</Td>
<Td>产物品级</Td>
</Tr>
<Tralign=center>
<Td>产物一</Td>
<Td>Thisisatest</Td>
<Tdalign=right>300.50</Td>
<Td>一级</Td>
</Tr>
<Tralign=center>
<Td>产物二</Td>
<Td>Thisisatest</Td>
<Tdalign=right>300.50</Td>
<Td>一级</Td>
</Tr>
<Tralign=center>
<Td>产物三</Td>
<Td>Thisisatest</Td>
<Tdalign=right>300.50</Td>
<Td>一级</Td>
</Tr>
</Tabld>
<inputtype=buttononclick="vbscript:buildDoc,4"value="build">
<BODY>
</BODY>
</HTML>
<scriptlanguage="vbscript">
SubbuildDoc(theTemplate,intTableRows)
DimTable1
setTable1=document.all.myData
row=Table1.rows.length
SetobjWordDoc=CreateObject("Word.Document")
ObjWordDoc.Application.Visible=True
DimtheArray(4,4)
RedimPreservetheArray(4,row)
colnum=Table1.rows(1).cells.length
fori=0torow-1
forj=0tocolnum-1
theArray(j+1,i+1)=Table1.rows(i).cells(j).innerHTML
next
next
intNumrows=4
objWordDoc.Application.ActiveDocument.Paragraphs.Add.Range.InsertBefore("测试的表格")
objWordDoc.Application.ActiveDocument.Paragraphs.Add.Range.InsertBefore("")
objWordDoc.Application.ActiveDocument.Paragraphs.Add.Range.InsertBefore("")
SetrngPara=objWordDoc.Application.ActiveDocument.Paragraphs(1).Range
WithrngPara
.Bold=True
.ParagraphFormat.Alignment=1
.Font.Name="Arial"
.Font.Size=12
EndWith
SetrngCurrent=objWordDoc.Application.ActiveDocument.Paragraphs(3).Range
SettabCurrent=ObjWordDoc.Application.ActiveDocument.Tables.Add(rngCurrent,intNumrows,4)
fori=1tocolnum
objWordDoc.Application.ActiveDocument.Tables(1).Rows(1).Cells(i).Range.InsertAftertheArray(i,1)
objWordDoc.Application.ActiveDocument.Tables(1).Rows(1).Cells(i).Range.ParagraphFormat.alignment=1
next
tabRow=2
Forj=2tointNumrows
ObjWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Borders.Enable=False
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(1).Range.InsertAftertheArray(1,j)
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(1).Range.ParagraphFormat.alignment=1
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(2).Range.InsertAftertheArray(2,j)
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(2).Range.ParagraphFormat.alignment=1
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(3).Range.InsertAfterFormatCurrency(theArray(3,j))
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(3).Range.ParagraphFormat.alignment=2
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(4).Range.InsertAftertheArray(4,j)
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(4).Range.InsertAfterChr(10)
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(4).Range.ParagraphFormat.alignment=1
tabRow=tabRow+1
Next
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(4).Range.ParagraphFormat.alignment=1
objWordDoc.Application.ActiveDocument.Paragraph.Add.Range.InsertAfter("")
objWordDoc.Application.ActiveDocument.Paragraph.Add.Range.InsertAfter("")
objWordDoc.Application.ActiveDocument.Paragraph.Add.Range.InsertAfter("Regards,")
objWordDoc.Application.ActiveDocument.Paragraph.Add.Range.InsertAfter("")
objWordDoc.Application.ActiveDocument.Paragraph.Add.Range.InsertAfter("DarylB.Morticum")
objWordDoc.Application.ActiveDocument.Paragraph.Add.Range.InsertAfter("SalesAssociate")
objWordDoc.Application.ActiveDocument.Envelope.InsertAddress
objWordDoc</p>结论:和PHP一样,ASP简单而易于维护,很适合小型网站应用,通过DCOM和MTS技术,ASP甚至还可以完成小规模的企业应用,但ASP的致命缺点就是不支持跨平台的系统,在大型项目开发和维护上非常困难。 |
|