| | |
Help to print the XML file
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
Didn't you post the same question in the C# forum?
Have you tried searching the web? Just go into the MSDN documentation, you'll find all your answers there.
To print XML form a dataset, you can use the
Have you tried searching the web? Just go into the MSDN documentation, you'll find all your answers there.
To print XML form a dataset, you can use the
WriteXml() function of the DataSet class. •
•
•
•
Didn't you post the same question in the C# forum?
Have you tried searching the web? Just go into the MSDN documentation, you'll find all your answers there.
To print XML form a dataset, you can use theWriteXml()function of theDataSetclass.
I fact i have posted this after searching over two days over internet but still unable to find a way to print the XML file to printer. Please help me.
Thanks and Best of Lusk,
Farid ud din Masood
MS.c (CS)
University of Agriculture, Faisalabad
Farid ud din Masood
MS.c (CS)
University of Agriculture, Faisalabad
>I fact i have posted this after searching over
>two days over internet
Well it seems like you haven't searched well. Anyways, you can find all the information about it in MSDN.
Just create a PrintDialog object and use it print the file.
>two days over internet
Well it seems like you haven't searched well. Anyways, you can find all the information about it in MSDN.
Just create a PrintDialog object and use it print the file.
VB.NET Syntax (Toggle Plain Text)
System.IO.StreamReader fileToPrint; System.Drawing.Font printFont; //Write the following in the PrintButton //CLick Event string printPath = this.textBox1.Text; fileToPrint = new System.IO.StreamReader(printPath); printFont = new System.Drawing.Font("Arial", 10); printDocument1.Print(); fileToPrint.Close(); //In the PrintDialog's PrintPage Event //Handler do the following float yPos = 0f; int count = 0; float leftMargin = e.MarginBounds.Left; float topMargin = e.MarginBounds.Top; string line = null; float linesPerPage = e.MarginBounds.Height / printFont.GetHeight(e.Graphics); while (count < linesPerPage) { line = fileToPrint.ReadLine(); if (line == null) { break; } yPos = topMargin + count * printFont.GetHeight(e.Graphics); e.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, yPos, new StringFormat()); count++; } if (line != null) { e.HasMorePages = true; } //Now in the browse button, form where //you get the xml filename into the //textbox, do the following in it's Click //Event. OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "XML Files (*.xml)|*.xml|All Files (*.*)|*.*"; if (openFileDialog1.ShowDialog() == DialogResult.OK) textBox1.Text = openFileDialog1.FileName;
![]() |
Similar Threads
- XML Bug Error. (XML, XSLT and XPATH)
- write/Read into XML File Using VC++ 6.0 please help me (XML, XSLT and XPATH)
- read xml using vb.net (VB.NET)
- Questions about file uploads (PHP)
- create pdf or word file from within c# (C#)
- How to read the parsed XML file (DOM parser) (Java)
- 500 ways to print [1..10]! (IT Professionals' Lounge)
- xml and p (Python)
- xml file parsing in c++ (C++)
- parsing error (XML file-java-schema) (Java)
Other Threads in the VB.NET Forum
- Previous Thread: Retrieving Data
- Next Thread: Confused
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2005 2008 access account application array arrays basic beginner browser button buttons center checkbox client code convert cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse excel fade filter forms ftp generatetags gridview html images inline input insert intel internet lib listview mobile monitor net objects open panel passingparameters pdf picturebox port position print printing problem read remove save searchvb.net select serial settings shutdown soap sorting sqlserver survey table temperature textbox timer timespan transparency trim update user validation vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web webbrowser winforms wpf wrapingcode year





