下载安卓APP箭头
箭头给我发消息

客服QQ:3315713922

教你用XML+VBS在ASP中实现报表的打印

作者:课课家教育     来源: http://www.kokojia.com/点击数:658发布时间: 2015-11-16 12:21:58

标签: XML

大神带你学编程,欢迎选课

欢迎来到小编的文章进行学习阅读,想必大家又有很多问题吧,在这里会有你想要收获的答案,请大家慢慢学习吧。excel教学

一、前言
ASP在电子商务上应用广泛,报表的处理又有一些麻烦。本文介绍了在ASP中利用本人写的Report Server Page脚本解释器实现报表的显示、打印。
二、准备工作
(1)安装Visual Reprort Design软件
Visual Report Design是本人写的一个免费的报表设计器,程序的发行只需要安装一个控件即可。
(2)设计报表
通过Visual Report Design 的可视化界面可以生成报表的脚本:mxb.rsp。
三、实现报表的打印、显示excel基础教程

well编程语言(programming language),是用来定义计算机程序的形式语言。它是一种被标准化的交流技巧,用来向计算机发出指令。一种计算机语言让程序员能够准确地定义计算机所需要使用的数据,并精确地定义在不同情况下所应当采取的行动。[1]
最早的编程语言是在电脑发明之后产生的,当时是用来控制提花织布机及自动演奏钢琴的动作。在电脑领域已发明了上千不同的编程语言,而且每年仍有新的编程语言诞生。很多编程语言
需要用指令方式说明计算的程序,而有些编程语言则属于声明式编程,说明需要的结果,而不说明如何计算。

下面是调用的文档:

以下为引用的内容:
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
%>
 

 
 

用Visual Report Design 产生的报表脚本mxb.rsp:



<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_head height="12">

成绩明细表


<page_head height="6">





姓名


语文


数学


英语


合计


平均


<page_body height="8">

<report_script>
Report.Write cstr(rs("xm"))



<report_script>
Report.Write cstr(rs("yw"))



<report_script>
Report.Write cstr(rs("sx"))



<report_script>
Report.Write cstr(rs("yy"))



<report_script>
Report.Write cstr((rs("yw")+rs("sx")+rs("yy"))/3)



<report_script>
Report.Write cstr(rs("yw")+rs("sx")+rs("yy"))


<page_foot height="7">

<report_script>
report.write "打印日期:"+formatdatetime(date(),1)



共%Pages%页,第%Page%页




<report_script>
do while not rs.eof
page_body()
rs.movenext
loop
rs.close
set rs=nothing
con.close
set con=nothing



excel教程

更多视频课程文章的课程,可到课课家官网查看。我在等你哟。

赞(115)
踩(1)
分享到:
华为认证网络工程师 HCIE直播课视频教程