Click to See Complete Forum and Search --> : Printing problems under ASP.NET and CR


frusciante8
February 2nd, 2005, 04:22 AM
Hi everyone,

I’ve got a problem for printing with Crystal Report – ASP.NET – C#. The printing goes well with a local printer but with a network printer I’ve got the following error :

Error in File C:\DOCUME~1\CCN115\ASPNET\LOCALS~1\Temp\temp_5a31aa9e-2ff8-49c4-be9f-0d0e12b0d09c.rpt: Request cancelled by the user.

My code :

private void PrintButton_Click(object sender, System.EventArgs e) { report.PrintOptions.PrinterName = "\\PC2\HP2300"; //report.PrintOptions.PrinterName = "MyHP2300"; <- Impression OK report.PrintToPrinter(1,false,0,0); }

I’ve made a lot of search and I’ve found that the problem looks to come from my user right.

http://support.businessobjects.com/communityCS/TechnicalPapers/crnet_web_app_printing.pdf

So, I’ve put my user to SYSTEM instead of machine in my machine.config in the framework. I’ve added the printers to my registry like it’s explain. But it still doesn’t work. I’ve seen that my added keys in [HKEY_USERS\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\...] disappear when I reboot my computer. Before the reboot, when the keys were there, my program doesn’t find them too.

If anyone have an idea …
Thanks a lot.