


A recent B/S project used a combination of embedding .net winform control and xml in IE when printing (see http://www.yesky.com/20030214/1652186.shtml ), in the actual application process, I have some experiences to share with you.
(1). Use a general template to format the XML file
There are three types of documents used in the system, namely the outbound order, the inbound order, and the delivery order. Therefore, three types of documents are defined. The template file has the following format
chukudan.xsl:
<?xml version="1.0" encoding="GB2312"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="Bill"> <root> <pagesetting> <landscape>false</landscape> <paperkind>Custom</paperkind> <paperwidth>800</paperwidth> <paperheight>600</paperheight> <paperleft>0</paperleft> <paperight>0</paperight> <papetop>0</papetop> <papebottom>0</papebottom> </pagesetting> <reporttable> <bill x="55" y="19" border="0" bordercolor="white" maxlines="6"> <xsl:for-each select="BillMaster"> <toptable width="743"> <tr height="20"> <td width="118" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white">车次号:</td> <td width="449" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="White"> <xsl:value-of select="SERIAL_NO" /></td> <td width="35" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white"></td> <td width="138" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white"></td> </tr> </toptable> </xsl:for-each> <detailtable width="373"> <xsl:for-each select="BillDetail"> <tr height="33"> <td width="90" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="White"> <xsl:value-of select="BILL_NO" /> </td> <td width="173" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white"> <xsl:value-of select="PROD_MODEL_2" /></td> <td width="55" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="White"> <xsl:value-of select="PROD_NUM" /></td> <td width="55" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white"> <xsl:value-of select="PIECE_NUM" /></td> </tr> </xsl:for-each> </detailtable> <mastertable width="370"> <xsl:for-each select="BillMaster"> <tr height="33"> <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="ADDRESS" /> </td> </tr> <tr height="33"> <td width="90" 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"> <xsl:value-of select="CONTACT_PERSON" /></td> <td width="70" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white"> </td> <td width="120" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="White"> <xsl:value-of select="CONTACT_PHONE" /></td> </tr> <tr height="33"> <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="DRIVER_UNIT" /></td> </tr> <tr height="33"> <td width="90" 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"> <xsl:value-of select="DRIVER_NO" /></td> <td width="70" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white"> </td> <td width="120" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white"> <xsl:value-of select="DRIVER_PERSON" /></td> </tr> <tr height="33"> <td width="90" 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"> <xsl:value-of select="CAR_MODEL" /> </td> <td width="70" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white"> </td> <td width="120" align="right" fontsize="10" fontname="宋体" fontcolor="black" b="true" i="false" u="false" bgcolor="white"></td> </tr> <tr height="33"> <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="COME_TO" /></td> </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>
Among them, toptable is the header, detailtable is the product details on the left side of the table, mastertable is the transportation information on the right side of the table, etc., and foottable is the bottom Tabulator and other information.
Then, in the asp.net page, convert the query results as follows
,,,,,,,,,,,,,,,,,,,,,,,,,’ Control:
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
Note that parent.frames is used to call the print control here.... This is to save the time of loading the print control every time the page is opened. A frame web page is used to print the The control is placed on a separate page so it does not need to be loaded each time.
The above is the content of practical examples of using XML to realize universal WEB report printing. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!

The implementation of RSS in XML is to organize content through a structured XML format. 1) RSS uses XML as the data exchange format, including elements such as channel information and project list. 2) When generating RSS files, content must be organized according to specifications and published to the server for subscription. 3) RSS files can be subscribed through a reader or plug-in to automatically update the content.

Advanced features of RSS include content namespaces, extension modules, and conditional subscriptions. 1) Content namespace extends RSS functionality, 2) Extended modules such as DublinCore or iTunes to add metadata, 3) Conditional subscription filters entries based on specific conditions. These functions are implemented by adding XML elements and attributes to improve information acquisition efficiency.

RSSfeedsuseXMLtostructurecontentupdates.1)XMLprovidesahierarchicalstructurefordata.2)Theelementdefinesthefeed'sidentityandcontainselements.3)elementsrepresentindividualcontentpieces.4)RSSisextensible,allowingcustomelements.5)Bestpracticesincludeusing

RSS and XML are tools for web content management. RSS is used to publish and subscribe to content, and XML is used to store and transfer data. They work with content publishing, subscriptions, and update push. Examples of usage include RSS publishing blog posts and XML storing book information.

RSS documents are XML-based structured files used to publish and subscribe to frequently updated content. Its main functions include: 1) automated content updates, 2) content aggregation, and 3) improving browsing efficiency. Through RSSfeed, users can subscribe and get the latest information from different sources in a timely manner.

The XML structure of RSS includes: 1. XML declaration and RSS version, 2. Channel (Channel), 3. Item. These parts form the basis of RSS files, allowing users to obtain and process content information by parsing XML data.

RSSfeedsuseXMLtosyndicatecontent;parsingtheminvolvesloadingXML,navigatingitsstructure,andextractingdata.Applicationsincludebuildingnewsaggregatorsandtrackingpodcastepisodes.

RSS documents work by publishing content updates through XML files, and users subscribe and receive notifications through RSS readers. 1. Content publisher creates and updates RSS documents. 2. The RSS reader regularly accesses and parses XML files. 3. Users browse and read updated content. Example of usage: Subscribe to TechCrunch's RSS feed, just copy the link to the RSS reader.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.