SAP Knowledge Base Article - Public

1198470 - Error: "The printer could not be found in the current security context" when trying to print through an ASP or ASP.NET application


When trying to print to a networked printer (for example: \\server\myprinter) through an ASP or ASP.NET application, the following error message appears:
"The printer could not be found in the current security context".

Your local printers are operating correctly but the error message persists even after following the steps in Microsoft's knowledge base article;en-us;184291.


In Windows 2003, the .DEFAULT registry, mentioned in the article listed above, is not read. The printer settings are stored in the user's hive that the web application is running under. The spooler is trying to open that user's registry hive and cannot. The user hive is not loaded unless the user logs on locally to the server.


To resolve this error message, complete the steps listed below:
  1. Set up your IIS Web Application to run under a domain account that has the network printer installed. 
  2. Configure the Windows Service(s) relevant to your application to run under that domain account. This has the affect of loading the printer information at run-time.  If you are using the Report Application Server SDK, change the properties of the RAS Service; if you use the Business Objects Enterprise SDK, change the properties of the Page Server and Cache Server if viewing on demand, or the Job Server if scheduling.


XIR2 , 3963994 , KBA , BI-DEV , Business Intelligence Software Development Kits (SDKs) , Problem


SAP Crystal Reports XI ; SAP Crystal Reports XI R2