Solved

print html with vb.net

Posted on 2011-09-02
3
365 Views
Last Modified: 2012-05-12
I have created a report that is formatted as html.  I need to print this using vb.net 2008.  The report is in memory, not a file or in a browser control.  Any guidance appreciated.

0
Comment
Question by:dhenderson12
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
Ambusy earned 500 total points
Comment Utility
Create a System.Windows.Forms.WebBrowser.
Write the HTML to a file (in your temp directory).
specify the file as the source for the webbrowser.  
WebBrowser.Url = New Uri(wrkFileName)

Open in new window

print it using:
 WebBrowser.ShowPageSetupDialog()
WebBrowser.Print()

Open in new window

0
 

Author Comment

by:dhenderson12
Comment Utility
good call.  actually you can just use the webbrowser.documenttext to load memory html and then just call the print() method.  

thx for the help
0
 
LVL 4

Expert Comment

by:Ambusy
Comment Utility
did not know about the documenttext, will try it. I saved my text first! thank you too.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now