ASP環境下輕鬆實現報表的列印 (轉)
一、前言
在電子商務上應用廣泛,報表的處理又有一些麻煩。本文介紹了在ASP中利用
本人寫的Report Server Page指令碼直譯器實現報表的顯示、列印。
二、準備工作
(1)Visual Reprort Design
Visual Report Design是本人寫的一個免費的報表設計器,的發行只需要
安裝一個60K的即可。
想要的網友可以到
(2)設計報表
透過Visual Report Design 的視覺化介面可以生成報表的指令碼:mxb.rsp。
三、實現報表的列印、顯示
下面是的文件:
printmx.asp
dim ReportName,ret
dim ReportAtl
dim name
set ReportAtl=Session("ReportAtl")
ReportName=Server.MapPath("mxb.rsp")
ret=reportatl.ToVBS(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
%>
< id=reportatl classid="clsid:D3F064E5-F4C0-4C52-9E7F-263D96B7EA11" codebase="Report.cab#version=1,0,0,1">
用Visual Report Design 產生的報表指令碼mxb.rsp:
dim rs,con,,lsh
dim temp
set con =CreateObject("ADO.Connection")
con.ConnectionString = "DBQ=c:reportdemoaspreport.mdb;={ Access Driver (*.mdb)};"
con.open
Set rs =CreateObject("ADODB.Recordset")
sql=" * FROM cj,student where cj.id=student.id "
rs.open sql,con,1,3
成績明細表
姓名
語文
數學
英語
合計
平均
Report.Write cstr(rs("xm"))
Report.Write cstr(rs("yw"))
Report.Write cstr(rs("sx"))
Report.Write cstr(rs("yy"))
Report.Write cstr((rs("yw")+rs("sx")+rs("yy"))/3)
Report.Write cstr(rs("yw")+rs("sx")+rs("yy"))
report.write "列印日期:"+formatdatetime(date(),1)
共%Pages%頁,第%Page%頁
do while not rs.eof
page_body()
rs.movenext
l
rs.close
set rs=nothing
con.close
set con=nothing
四、其它資訊
這是本人第一個開發工具,做得不好請指教
詳細情況可以看:
關於在ASP下使用的詳細例子可以看c:demoasp/目錄
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752043/viewspace-990431/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 輕鬆實現報表整合
- 在ASP.NET裡輕鬆實現縮圖 (轉)ASP.NET
- Word中輕鬆實現逆頁序列印
- web 報表中電子圖章 / 水印的輕鬆實現Web
- linux環境下輕鬆搭建CVS伺服器(還是轉的)Linux伺服器
- XML 在 ASP 環境下的應用(轉)XML
- web 報表輕鬆實現資料異常預警功能Web
- 在ASP程式中列印Excel報表的新方法 (轉)Excel
- Linux環境下的高階列印系統(轉)Linux
- 如何實現報表的批次列印需求
- 輕鬆實現session的mysql處理 (轉)SessionMySql
- 輕鬆使用 Linux Equinox 桌面環境LinuxUI
- 如何實現報表直接列印需求
- 輕鬆實現刪除確認 (轉)
- 帶你輕鬆使用Hyperf玩轉Grpc(一)環境搭建RPC
- 在.NET環境下將報表匯出EXCEL和WORD (轉)Excel
- [譯] 輕鬆管理 Swift 專案中的不同環境Swift
- CUPS讓Linux列印變得更輕鬆(轉)Linux
- birt報表:BIRT報表在TOMCAT下執行環境配置!Tomcat
- 輕鬆玩轉花樣表單表單提交(轉)
- Linux圖形介面知識-輕鬆更換圖形環境(轉)Linux
- mirrord:輕鬆地將流量從生產環境映象到開發環境開發環境
- DSP應用例項(一)--輕鬆實現BT多點下載 (轉)
- [轉]Android輕鬆實現RecyclerView懸浮條AndroidView
- 輕鬆實現SINDOWS 98動態選單 (轉)
- next.js+koa2+antd環境輕鬆搭建JS
- 輕鬆搞定分組報表中的各種排序排序
- J2EE中列印報表怎麼實現
- rac環境下standby資料庫的實現資料庫
- Linux環境下實現NTFS分割槽完全讀寫的方法(轉)Linux
- 輕鬆實現在家高效辦公
- 輕鬆實現 Web 效能優化Web優化
- 輕鬆兩步,搭建斷點除錯 PHP 原始碼環境斷點除錯PHP原始碼
- TextView自定義輕鬆實現下劃線、點選彈框TextView
- 辦公室革命,教你輕鬆搞定輕鬆玩轉ExcelExcel
- JNPF讓你輕鬆點亮報表應用技能
- linux環境下的undelete(轉)Linuxdelete
- 如何在 Objective-C 的環境下實現 deferObject