Are you aware that your code runs on the server side and that it will print the report to some printer available at the server? If you expect to get that code working on the client i.e. that the user can print the displayed report to his local printer, then
it won't work. Now, your code is working on your machine because it is acting like the client & the server i.e. both roles but if you publish your code to an external server, then it won't work. So the question is... do you want to get your report printed
at the server to some printer installed there OR to the client printer? If it's the first one, then just create some page asking the user for num of copies and go ahead with your code. BUT if it is the second option you need, then you can export the report
to PDF and then display it to the user so it can print it "manually" or try using
this code which makes the job a little bit smoothly.
Barcode, Labeling, Printing & Imaging tools for ASP.NET Developers
Member
30 Points
160 Posts
How to show PrintDialog when I click Print button instead of printing directly to the printer
Apr 01, 2014 04:33 PM|human2x|LINK
Hi all
I designed a crystal report and added a button to print the report contents using the following code:
this command send the report directly to the printer without showing the Print Dialog Box
I need to show the dialog box so I can select the printer and pages to print. !!!
Please don't provide links to similar subject because I went through many of them but with no result.
Member
465 Points
306 Posts
Re: How to show PrintDialog when I click Print button instead of printing directly to the printer
Apr 01, 2014 05:04 PM|asif iqbal|LINK
Try the following code
you will have to change the "username" and the "password" with the credentials of your database.
- Asif
Participant
1170 Points
367 Posts
Re: How to show PrintDialog when I click Print button instead of printing directly to the printer
Apr 03, 2014 07:40 AM|Neodynamic|LINK
Are you aware that your code runs on the server side and that it will print the report to some printer available at the server? If you expect to get that code working on the client i.e. that the user can print the displayed report to his local printer, then it won't work. Now, your code is working on your machine because it is acting like the client & the server i.e. both roles but if you publish your code to an external server, then it won't work. So the question is... do you want to get your report printed at the server to some printer installed there OR to the client printer? If it's the first one, then just create some page asking the user for num of copies and go ahead with your code. BUT if it is the second option you need, then you can export the report to PDF and then display it to the user so it can print it "manually" or try using this code which makes the job a little bit smoothly.
Member
465 Points
306 Posts
Re: How to show PrintDialog when I click Print button instead of printing directly to the printer
Apr 03, 2014 10:43 AM|asif iqbal|LINK
I hope the solution helped you. Please let us know.
- Asif