Printing Crystal report thro' ASp.Net
Hi,
I am develpoing an intranet application using ASP.Net which uses crystal reports. The IIS is installed in my machine. But the printer is connected to some other. When I try to take printout it raises an error as:
Error in File C:\DOCUME~1\banupriya\ASPNET\LOCALS~1\Temp\temp_2924ba53-898a-4038-a402-b1504cbdbe18.rpt: Request cancelled by the user.
The code I used is:
crpt.PrintOptions.PrinterName = "\\banupriya\hp LaserJet 1300 PCL 6"
crpt.PrintToPrinter(1, False, 1, 1)
Note: This code works when I connect & install the printer to my machine.
Can any one please say me how to fix this problem.
Thankyou for your reply.
reg
Banupriya
re: printing crystal report using asp dot net
Hi,
I am sending this again since I don't get any reply yet.
I am develpoing an intranet application using ASP.Net which uses crystal reports. The IIS is installed in my machine. But the printer is connected to some other. When I try to take printout it raises an error as:
Error in File C:\DOCUME~1\banupriya\ASPNET\LOCALS~1\Temp\temp_2924ba53-898a-4038-a402-b1504cbdbe18.rpt: Request cancelled by the user.
The code I used is:
crpt.PrintOptions.PrinterName = "\\banupriya\hp LaserJet 1300 PCL 6"
crpt.PrintToPrinter(1, False, 1, 1)
Note: This code works when I connect & install the printer to my machine.
Can any one please say me how to fix this problem.
Thankyou for your reply.
reg
Banupriya
Solution for Printer Problem
Dear Friends,
Iam sorry for the delay reply.
1. robinash, what you says is correct, the network printer won't recognize without network path.
2. if you want to view the installed printer list, refer the following code.
(But It's not a bug).
Code:
Imports System.Drawing.Printing
Dim fwPrintSetting As new System.Drawing.Printing.PrinterSettings
Dim nCnt As Integer
With cboPrinter.Items
For nCnt = 0 To (PrinterSettings.InstalledPrinters.Count - 1)
.Add(PrinterSettings.InstalledPrinters.Item(nCnt))
fwPrintSetting.PrinterName = fwPrintSetting.InstalledPrinters.Item(nCnt)
Next
End With
3. The reported error is
"Error in File C:\DOCUME~1\banupriya\ASPNET\LOCALS~1\Temp\temp_2924ba53-898a-4038-a402-b1504cbdbe18.rpt: Request cancelled by the user . "
a. Make sure the security permissions are correctly.
b. Do Testing printout from other reports.
Thanks.
Quote:
Originally posted by robinash
I think you didn't understand the problem. I have exactly the same.
It work fine with a local printer but if you want to use a printer on the network it doesn't work !
If he change the name of the network printer in the parameters his computer won't recognize the printer after this.
I think it's a bug (one more !!) of crystal !!
But if someone has the solution it could be great !!
Thanks
Nicolas