Solved

print html with vb.net

Posted on 2011-09-02
3
368 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

867 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

26 Experts available now in Live!

Get 1:1 Help Now