Solved

Print from template with placeholders

Posted on 2010-11-23
2
1,134 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

3 Use Cases for Connected Systems

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
.net and XML report from SCCM 5 24
Question! 4 36
HTML - Color not displaying correctly in EMAIL. 6 37
How come this regular expression allows "e"? 14 38
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

773 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