日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

用XML VBS在ASP中實(shí)現(xiàn)報(bào)表的打印_Xml教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:對XML數(shù)據(jù)使用XMLConvert
XML文件中的所有數(shù)據(jù)都以字符串來存儲。當(dāng)一個(gè)程序載入XML文件時(shí),通常需要將數(shù)據(jù)轉(zhuǎn)換為更加適合程序的類型。 例如,假設(shè)訂單裝運(yùn)日期存在一個(gè)XML文件里,則使用該文件的程序需要將字符串表示

一、前言

ASP在電子商務(wù)上應(yīng)用廣泛,報(bào)表的處理又有一些麻煩。本文介紹了在ASP中利用本人寫的Report Server Page腳本解釋器實(shí)現(xiàn)報(bào)表的顯示、打印。

二、準(zhǔn)備工作

(1)安裝Visual Reprort Design軟件

Visual Report Design是本人寫的一個(gè)免費(fèi)的報(bào)表設(shè)計(jì)器,程序的發(fā)行只需要安裝一個(gè)控件即可。

(2)設(shè)計(jì)報(bào)表

通過Visual Report Design 的可視化界面可以生成報(bào)表的腳本:mxb.rsp。

三、實(shí)現(xiàn)報(bào)表的打印、顯示

下面是調(diào)用的文檔:

以下為引用的內(nèi)容:

printmx.asp
<%Option Explicit%>
<%
dim ReportName,ret
dim ReportAtl
dim name
set ReportAtl=Session("ReportAtl")
ReportName=Server.MapPath("mxb.rsp")
ret=reportatl.XMLToVBS(ReportName)
if ret=-1 then
response.write reportatl.ErrorMsg
response.end
end if

ReportName=Server.MapPath("mxb.vbs")
ret=reportatl.DoScript(ReportName)
if ret=-1 then
response.write reportatl.ErrorMsg
set ReportAtl=nothing
response.end
end if
set ReportAtl=nothing
%>
<html>
<OBJECT id=reportatl classid="clsid:D3F064E5-F4C0-4C52-9E7F-263D96B7EA11" codebase="Report.cab#version=1,0,0,1">
</OBJECT>
<script language=vbscript>
dim ret
ret=reportatl.DoPrintReport("mxb.zcg")
if ret=-1 then
msgbox reportatl.ErrorMsg
end if
</script>
</html>
用Visual Report Design 產(chǎn)生的報(bào)表腳本mxb.rsp:
<?xml version="1.0" encoding="GB2312" ?>
<!DOCTYPE report SYSTEM "print_report.dtd" >
<report name="報(bào)表">
<report_script>
dim rs,con,sql,lsh
dim temp
set con =CreateObject("ADODB.Connection")
con.ConnectionString = "DBQ=c:\report\demo\asp\report.mdb;DRIVER={Microsoft Access Driver (*.mdb)};"
con.open
Set rs =CreateObject("ADODB.Recordset")
sql="SELECT * FROM cj,student where cj.id=student.id "
rs.open sql,con,1,3
</report_script>
<report_head height="12">
<text name="vfptext" top="4" left="76" width="26" height="5" font_name="宋體" font_size="14" font_weight="700" font_italic="0" font_underline="0" >
成績明細(xì)表
</text>
</report_head>
<page_head height="6">
<line name="vfpline" top="0" left="9" width="178" height="0" weight="131072">
</line>
<line name="vfpline" top="6" left="9" width="178" height="0" weight="131072">
</line>
<text name="vfptext" top="2" left="18" width="6" height="3" font_name="宋體" font_size="9" font_weight="700" font_italic="0" font_underline="0" >
姓名
</text>
<text name="vfptext" top="2" left="46" width="6" height="3" font_name="宋體" font_size="9" font_weight="700" font_italic="0" font_underline="0" >
語文
</text>
<text name="vfptext" top="2" left="72" width="6" height="3" font_name="宋體" font_size="9" font_weight="700" font_italic="0" font_underline="0" >
數(shù)學(xué)
</text>
<text name="vfptext" top="2" left="99" width="6" height="3" font_name="宋體" font_size="9" font_weight="700" font_italic="0" font_underline="0" >
英語
</text>
<text name="vfptext" top="2" left="162" width="6" height="3" font_name="宋體" font_size="9" font_weight="700" font_italic="0" font_underline="0" >
合計(jì)
</text>
<text name="vfptext" top="2" left="130" width="6" height="3" font_name="宋體" font_size="9" font_weight="700" font_italic="0" font_underline="0" >
平均
</text>
</page_head>
<page_body height="8">
<text name="vfptext" top="2" left="15" width="25" height="4" font_name="宋體" font_size="9" font_weight="100" font_italic="0" font_underline="0" >
<report_script>
Report.Write cstr(rs("xm"))
</report_script>
</text>
<text name="vfptext" top="2" left="45" width="18" height="4" font_name="宋體" font_size="9" font_weight="100" font_italic="0" font_underline="0" >
<report_script>
Report.Write cstr(rs("yw"))
</report_script>
</text>
<text name="vfptext" top="2" left="71" width="18" height="4" font_name="宋體" font_size="9" font_weight="100" font_italic="0" font_underline="0" >
<report_script>
Report.Write cstr(rs("sx"))
</report_script>
</text>
<text name="vfptext" top="2" left="98" width="18" height="4" font_name="宋體" font_size="9" font_weight="100" font_italic="0" font_underline="0" >
<report_script>
Report.Write cstr(rs("yy"))
</report_script>
</text>
<text name="vfptext" top="2" left="130" width="18" height="4" font_name="宋體" font_size="9" font_weight="100" font_italic="0" font_underline="0" >
<report_script>
Report.Write cstr((rs("yw") rs("sx") rs("yy"))/3)
</report_script>
</text>
<text name="vfptext" top="2" left="162" width="18" height="4" font_name="宋體" font_size="9" font_weight="100" font_italic="0" font_underline="0" >
<report_script>
Report.Write cstr(rs("yw") rs("sx") rs("yy"))
</report_script> </text>
</page_body>
<page_foot height="7">
<text name="vfptext" top="2" left="12" width="13" height="3" font_name="宋體" font_size="9" font_weight="100" font_italic="0" font_underline="0" >
<report_script>
report.write "打印日期:" formatdatetime(date(),1)
</report_script>
</text>
<text name="vfptext" top="2" left="137" width="50" height="3" font_name="宋體" font_size="9" font_weight="100" font_italic="0" font_underline="0" >
共%Pages%頁,第%Page%頁
</text>
<line name="vfpline" top="0" left="8" width="178" height="0" weight="131072">
</line>
</page_foot>
<report_script>
do while not rs.eof
page_body()
rs.movenext
loop
rs.close
set rs=nothing
con.close
set con=nothing
</report_script>
</report>

分享:XMLHTTP對象封裝技術(shù)
Ajax技術(shù)的實(shí)現(xiàn)主要依賴于xmlhttprequest,但我們在調(diào)用其來進(jìn)行異步數(shù)據(jù)的傳輸時(shí),由于xmlhttp是個(gè)短線過程(處理事件完成后就銷毀)如果不對該對象進(jìn)行包裝處理的話,就不得不在需要調(diào)用的地

來源:模板無憂//所屬分類:Xml教程/更新時(shí)間:2008-08-22
相關(guān)Xml教程