on 2008 Nov 06 9:31 PM
I have a Visual Studio 2008 web project that uses Crystal Reports. The CrystalDecisions assembly version is 10.5.3700.0. The application displays a Crystal Report in the browser, allowing the user to print. The print operation happens on the server through code I have written. Users print to a printer configured for their user account so the application uses many different print queues installed on the web server.
This application has been in production for over a year, working fine. For some reason, last week, certain users could no longer print. The error is the "missing parameter values" message that I've seen on this forum. However, my code has not changed, and printing works for most users. Just a few are having the problem.
All the users that are having problems are using HP Laserjet 4200 printers with the PCL6 or PCL5e driver. These printers work otherwise as a test page prints fine.
Are there any known issues with specific print drivers and Crystal Reports for Visual Studio 2008, or anything else you can think of?
Thanks,
Ray
Hello, Ray;
Are the reports that fail always the same ones? Does the same report work correctly for some people but not others.
What type of database are you connecting to? Do you logon in code?
When you look at the reports that are failing, do they have parameter fields?
Are the parameter values being passed in code?
This error is usually exactly what it says: "missing parameter values"
There is a known issue if the parameter is set to "Optional"
[Click|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_boj_dev/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
The report will fail to print because it does not get the data that is required to complete successfully.
Elaine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Elaine,
Thanks for your clarifying questions.
The application has several reports but I would say there is one in particular that is being used here. All the reports have parameter fields, and all parameters are explicitly provided. I do not use optional parameters. I am connecting to a SQL Server 2000 database and I do logon in code by prepping the ConnectionInfo object and passing it to ApplyLogOnInfo for each report table.
If a user is configured to print to one printer, say printer X, it will work. If the same user is then configured to print to printer Y, it fails with the "missing parameter values" error. Same report, same parameters, same user, only different printer name. It sounds like a printer problem, but the printer works except when Crystal Reports tries to use it. So could it be a driver issue or some arcane twist?
Here's the code that sets the printer name:
Public Shared Sub Print(ByVal rRptparms As Report.Parameters)
Dim rpt As ReportDocument
'Prepare and print the report.
rpt = Prepare(rRptparms)
rpt.PrintOptions.PrinterName = CStr(HttpContext.Current.Session("sEmpPtr"))
rpt.PrintToPrinter(1, False, 0, 0)
rpt.Dispose()
End Sub
The Session("sEmpPtr") would be a value like "
servername\printername".
Thanks,
Ray
Hello, Ray;
Crystal Reports needs to have the printer driver being used visible to the report. We read the driver for formatting and for printing.
Does the ASPNET Worker Process have full rights to the loacation of the printer drivers? Particularly the drivers for the HP Laserjet 4200 printers. They must be installed locally on the Application server.
Depending on the operating system it is LocalMachine\IIS_WPG (Windows 2003 Server) or ASPNET (XP) or IIS_IUSRS (Vista)
To give the IIS_WPG account full control of a folder:
1. Right-click the folder and select 'Properties'.
2. Go to the 'Security' tab and click the 'Add' button.
3. Click the 'Locations' button and select the
computer name. Click 'OK'.
4. Type "IIS_WPG" under the 'Enter the object names to
select' box.
5. Click 'Check Names'. <Your machine name>\IIS_WPG
appears. Click 'OK'.
6. Check 'Full Control' from 'Permissions for IIS_WPG'.
Click 'OK'.
====================
NOTE:
The IIS_WPG includes the LocalService,
System, and NetworkService accounts.
====================
Looking at the code the only other questions I have at the moment are the lines:
CStr(HttpContext.Current.Session("sEmpPtr")
I am assuming the new printer is the name that has been put into session in another piece of code?
Also the code "Prepare(rRptparms)" has some method to handle postback for the logon and parameters if necessary?
Elaine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry it took me so long to respond. I had to wait until I could visit the client and set up a debugging session to dig deeper into the problem.
Here's a summary of what I now know. My initial post is still valid. When any user is configured through a .NET Session variable to use certain HP 4200 Laserjet printers, the "missing parameter" error is the result. I confirmed in debugging that all parameters are passed to the report. In fact, the code throws an exception on the following line:
rpt.PrintOptions.PrinterName = CStr(HttpContext.Current.Session("sEmpPtr"))
An example of how this would translate is:
rpt.PrintOptions.PrinterName = "
gsf2\q-23-f"
The error happens for any user that is configured to use that printer. The same user can print the report with no error if only the printer name is changed.
Interestingly, I found a workaround, but not a permanent solution. The workaround involves using local queues. All the printers for this application are network printers and queues are defined on the server
gsf2. For the problem printers, I created a separate queue on the web server,
gsw1. When the user has the printer name set to "
gsw1\q-23-f", it works!
I have checked the permissions many times, and asked others to do the same. 100% of the print queues on
gsf2 work for other applications. 90% of the print queues on
gsf2 print this Crystal Report just fine. 10% of the print queues fail unless a print queue on
gsw1, the local web server, is used.
All the problem printers are HP 4200s. But not all the HP 4200s are a problem. I did find out some updates were installed on the server that created this problem in the first place. Those updates have been backed off of the server but to no avail.
I have reinstalled CRRedist2008_x86.msi and the web application. I have rebooted the server.
I know this is esoteric, but I'm at the end of my rope.
Thanks in advance,
Ray
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.