I have read most of the articles, but I hope that by further defining the problem I might get a more specific example.
I have a WinForms application that has a user control that displays the results of a query in a format that resembles a report (mostly labels and text boxes). I need to somehow capture the contents of the user control and send it to the printer
Loading
Purushottam RathorePosted Dec 31, 2009, 12:03 AM
Try to use this javascript.
// JScript File
function GetPrintVersion()
{
if (document.getElementById != null)
{
var html = '\n\n';
if (document.getElementsByTagName != null)
{
var headTags = document.getElementsByTagName("head");
if (headTags.length > 0)
html += headTags[0].innerHTML;
}
html += '\n\n\n\n';
var printReadyElement1 = document.getElementById("div1");
var printReadyElement2 = document.getElementById("div2");
if (printReadyElement1 != null)
{
html += '\n\n';
var printWin = window.open();
printWin.document.open();
printWin.document.write(html);
}
else
{
alert("The print ready feature is only available if you are using an browser. Please update your browswer.");
}
}
(GetPrintVersion())">