2
votes

I am using Crystal Report for reporting. I want to print directly instead of showing crystal report viewer. I used

rpt.PrintToPrinter(1, false, 0, 0);

which is working fine on local but when I host it to iis server it's not working. I think it try to find the default printer on the server side instead of client side. I may be wrong. can anybody guide me for this?

Thanks in advance.

1
If you want for all clients to print in one server printer you have to set default printer to the server. If you want for client print is another thing.kostas ch.
If you want direct print to client you have to use activex or silverlight.kostas ch.
I can set activeX to the CrystalReportViewer not Report Document so it will not work for this PrintToPrinter() method. I also tried activeX method but controls(Print/Export) on CrystalReportViewer are also not working. :(Ankit
You either to buy external activex or make your. Silverlight is also a good approach. But you have to create your report by your own. Create everything in silverlight. If you want to stay in Crystal you have to buy component which do a silent print.kostas ch.

1 Answers

0
votes

"PrinttoPrinter" is print default printer of the server, not at client printer. Because your code ("PrintToPrinter") execute on the server machine where your code is published. So while executing code, it searches in local machine i.e. server, and order to print on default printer of the server (if it is set).

So if you wish to print file at client side, you may simply create a pdf from your code and show to client side to download or print. Also crystal report will generate the pdf via code that will you send at client level.

http://forums.asp.net/t/1866530.aspx?My+crystal+report+does+not+connect+to+client+side+printer+in+asp+net+application+

http://forums.asp.net/t/1840284.aspx?print+direct+not+work

http://forums.asp.net/t/1842337.aspx?need+to+print+crystal+report+to+printer+client