cancel
Showing results for 
Search instead for 
Did you mean: 

PrintToPrinter Not working in Web Server

former_member373051
Participant
0 Kudos

Dear Experts,

                    I have created report for direct printing at client machine. It's working in Local machine. Once i deployed in web server

first time itself viewer opening then second time page loading only even viewer didn't open.

rpt.PrintToPrinter(No_of_copies, True, 0, 0)

Once i comment this line and restart the server first time only viewer opening. i cannot find why it's happening...

How can i solve this issues ?

thanks in advance,

Mani

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hi Mani

The thing to understand is that the app and thus the report engine is running on the server and thus will use the printer driver installed n the server. For your requirement I think the following MS KBA will help:

COM objects fail to print when called from ASP

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

former_member373051
Participant
0 Kudos

Dear Ludek,

                    thanks for your reply. i'll install printer driver in web server and check.

regards,

Mani.

former_member373051
Participant
0 Kudos

Hi Ludek,

               After installing default printer on Server, i got No printers installed.

below is my code, (checking in Default printer installed or not in TRY)

CR_TGL_EBL.HasPrintButton = False

CR_TGL_EBL.ReportSource = rpt

Try

rpt.PrintToPrinter(No_of_copies, True, 0, 0)

Catch ex As Exception

Page.ClientScript.RegisterStartupScript([GetType](), "printer Problems", (Convert.ToString("alert('" + ex.Message + " ")) +"Your associated printer not working contact the admin!');", True)

End Try

Even i installed default printer i got alert message, How to get direct print in server.

Locally it's working fine. Once i enable printtoprinter it's loading only...

Please help me to solve this issue...

Regards,

Mani.

former_member183750
Active Contributor
0 Kudos

From the screenshot of the error message, I'd say this is not a Crystal reports issue(?). You may want to see the Admin, or perhaps use a utility such as Process Monitor, see what is actually happening.

- Ludek

former_member373051
Participant
0 Kudos

Hi Ludek,

              Yes, that screen shot not a crystal report issues, that's a alert message only, after installing default printer in web server i cann't access the printtoprinter() method.

How can i get print from application running from web server?

i have searched lots in google.

Please suggest any solution for direct print to client machine...

Thanks in advance.

former_member183750
Active Contributor
0 Kudos

Ahhh. I think this MS KBA is what you are looking for:

COM objects fail to print when called from ASP

- Ludek

Answers (0)