PDA

View Full Version : Print a Crystal Report


petertran123
04-14-2003, 08:24 PM
I need to print a Crystal Report from the asp page to the client's local printer without previewing it. Can someone help me with any sample code. Thanks in advanced

BigDaddy
04-14-2003, 08:54 PM
You can't do it. You can use javascript and do an

Onload = "document.print", to print it, but it's going to still bring up the print dialog box--but you cannot access the client's printer directly. I had it explained to me as the idea that you wouldn't want the printer accessible to the web, for the fact that a print virus could print 10,000,000 copies as soon as you view a page.

If you're using the ActiveX viewer, and maybe the java viewer, and try the document.print option, it will likely cause just an outline of the page to print, with the window contents blank.

What I do is open my reports in a new window, and using javascript, set the window properties to no toolbars. That way, the only print button you see on the page is the one on the crystal viewer.