All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
测试,Apache,Web,和,PHP,应用程序服务器_php资料_编程技术
ASP.NET应用程序_[Asp.Net教程]
浅谈当下网页设计趋势_优化技巧_seo学堂
SQL,Server和Oracle的常用函数对比_mssql学习_编程技术
ASP.NET程序实现多彩下拉框开发实例解析_.net资料_编程技术
PHP+MYSQL留言本_[PHP教程]
详解:——如何将图片储存在数据库里_php资料_编程技术
SQLServer和Access、Excel数据传输_[SQL,Server教程]
符合web标准的媒体播放器代码_[Html教程]
如何将应用程序由ASP.NET,1.1移植到ASP.NET,2.0_.net资料_编程技术
Reading number is top 10 pictures
擦地板的大叔太好了
Beauty Sun Feifei
Absolutely shocked. National geographic 50 animal photographys4
代沟,真好
Take you to walk into the most true north Korea rural3
漂亮的跳舞妹妹1
Absolutely shocked. National geographic 50 animal photographys8
日本小萝莉1
Chinese paper-cut grilles art appreciation8
2012 national geographic daily picture7
Download software ranking
Twenty piece of palm leaf
传奇私服架设教程-chm
Unix video tutorial9
仙剑奇侠传98硬盘WINXP版
网络管理员第三版
尖东毒玫瑰B
电车之狼R
C语言教程TXT
Prostitutes diary
Unix video tutorial12
归海一刀 published in(发表于) 2014/3/20 5:15:37 Edit(编辑)
利用XML实现通用WEB报表打印实际使用中的例子_[XML教程]

利用XML实现通用WEB报表打印实际使用中的例子_[XML教程]

利用XML实现通用WEB报表打印实际使用中的例子_[XML教程]

最近做的一个B/S项目,在打印时采用了在IE中嵌入.net winform控件和XML结合的方式(参见http://www.yesky.com/20030214/1652186.shtml),在实际应用过程中,有一些心得,和大家分享。
(一).使用通用模版格式化XML文件
系统****用到了三种单据,分别为出库单,入库单,送货单,因此,定义三个模版文件,格式如下:
chukudan.xsl:





false
Custom
800
600
0
0
0
0








车次号:



























































































































































其中,toptable是表头,detailtable是表格左边的产品明细,mastertable是表格右边的运输信息等,foottable是最下面制表人等信息。


然后,在asp.net页面中,将查询出的结果作如下转换


'是否取得了单据
If billInfoXml <> Nothing Then


billInfoDoc.LoadXml(billInfoXml)
'billInfoDoc.LoadXml("http://111.111.111.111/stockmg/test.xsl")
billTrans.Load(billFormatXmlUrl)


billXmlWr.Formatting = System.Xml.Formatting.Indented
billXmlWr.Indentation = 4
billXmlWr.IndentChar = " "


billTrans.Transform(billNav, Nothing, billXmlWr, Nothing)
billXmlWr.Flush()


End If


返回的信息用javascript代码加载到打印控件:
parent.frames.frmhidPrint.parent.frames.frmhidPrint.print1.SetXml(xmlResult); //SetMessage(xmlResult); parent.frames.frmhidPrint.parent.frames.frmhidPrint.print1.PrintAct();


注意,这里调用打印控件用了parent.frames....这是为了节省每次打开页面时加载打印控件的时间,使用了一个框架网页,把打印控件放在一个单独的页面中,从而不需每次加载。


第一次发帖,包涵,呵呵。


出处:品味技术 感受人生 BLOG







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.