Solved

Print from template with placeholders

Posted on 2010-11-23
2
1,135 Views
Last Modified: 2012-05-10
We are currently printing some forms (e.g. invoices, delivery notes) by using HTML template with placeholders and the WebBrowser object for rendering and printing it with WebBrowser.print(). In order to send it to a certain printer we set the system default printer to the printer we need, print and set it back afterwards.
This creates issues, e.g. that we have no reliable feedback from the object whether the printing has finished, thus it is obviously a workaround we'd like to resolve different.

Is there a way to directly set the printer for the WebBrowser object?

Otherwise can you recommend a convenient way to print with the help of templates and placeholders, like e.g. HTML, Word formats, or anything else that does not need user interaction for printing and selecting the printer?


Its a c# .net 3.5 desktop application

Thanks, Paul
0
Comment
Question by:paulwehle
2 Comments
 
LVL 3

Accepted Solution

by:
chrios earned 50 total points
ID: 34203128
I don't believe you can set the printer that easily from the webbrowser object. Another drawback with using the webbrowser for printing is that it uses the same settings as internet explorer, such as the page header and footer.

The solution I used for my project was instead crystal reports. The downside with CR is that you will have to make sure that the client computer has the Crystal Reports Runtime Packages installed.

The code project has an article that may be interesting if you decide to try it: Choosing a printer when printing from Crystal Reports in C#
0
 

Author Closing Comment

by:paulwehle
ID: 34238737
It was the right suggestions which will do it for our windows application. Even the licensing works for us
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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