Solved

print html with vb.net

Posted on 2011-09-02
3
381 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
Ambusy earned 500 total points
ID: 36477210
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
ID: 36477798
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
ID: 36478163
did not know about the documenttext, will try it. I saved my text first! thank you too.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

635 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