栏目导航
热点推荐
- 用JDOM创建XML文件源代码
- 利用XML和XSL来生成动态页面
- WAP网站建设全攻略教程
- XML结构与语法入门详解
- XSLT Designer快速入门指南
- XML入门的常见问题(三)
- XML入门的常见问题(四)
- XMLHTTPRequest属性及方法详解教
- 用XML和XSL来生成动态页面
- XML教程:XML有哪些用途?
- 什么是 XML Web Service
- 如何建立一个 XML 的开发环境
阅览排行
利用XML实现通用WEB报表打印实际使用中的例子
www.jz123.cn 2008-11-10 来源: 中国建站 袁袁整理 我要投递新闻
</tr>
</xsl:for-each>
</mastertable>
<foottable width="743">
<xsl:for-each select="BillMaster">
<tr height="35">
<td width="90" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="White"></td>
<td width="173" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white"></td>
<td width="55" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="White"></td>
<td width="55" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white"></td>
<td width="90" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white">
</td>
<td width="280" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white"><xsl:value-of select="REMARK" /></td>
</tr>
</xsl:for-each>
</foottable>
</bill>
</reporttable>
</root>
</xsl:template>
</xsl:stylesheet>
其中,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
上一篇:从XML中读取数据到内存的实例 下一篇:新兴XML处理方法VTD-XML介绍