Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing on client computer using ASP.Net

Status
Not open for further replies.

nghouri

Programmer
Jul 23, 2003
2
US
Hi All !

I m working on a web application using ASP.Net and using CrystalReportViewer for reporting on web. Well I have a problem, as per requirement I have to print report on client computer directly from webform without displaying CrystalReportViewer. I dont know exactly how to do it. I tried to get some help but i couldnt proceed.

I would be very thankful if anyone could help me.

Thanks & Regards

Maan
 
Hi All !

I m working on a web application using ASP.Net and using CrystalReportViewer for reporting on web. Well I have a problem, as per requirement I have to print report on client computer directly from webform without displaying CrystalReportViewer. I dont know exactly how to do it. I tried to get some help but i couldnt proceed.

I would be very thankful if anyone could help me.

Thanks & Regards
 
I haven't used CrystalReportViewer, but I had a need to print something on a client's PC...What I did was:

1. Open a new window for the form needing printing.
2. Keep the focus on the main window (the new window is underneath the main one).
3. Added javascript to the form needing printing to print the form.
4. Close the form via javascript.

<script language=&quot;JavaScript&quot;>
<!--
function DoPrint() {
window.opener.focus();
var WebBrowser = '<OBJECT ID=&quot;WebBrowser1&quot; WIDTH=0 HEIGHT=0 CLASSID=&quot;CLSID:8856F961-340A-11D0-A96B-00C04FD705A2&quot;></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(6, -1);
WebBrowser1.outerHTML = &quot;&quot;;
window.close();
}
//-->
</script>

<body onload=&quot;javascript:DoPrint()&quot; MS_POSITIONING=&quot;GridLayout&quot;>


The OBJECT ID=&quot;WebBrowser1&quot; will allow the user to print w/o the print dialog box to appear...

Good luck...
Jerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top