Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer Problem

Status
Not open for further replies.

OzWolf

Programmer
May 22, 2002
52
0
0
AU
Greetings,

I have run into a somewhat unusual problem with a distributed app that I support. It all has to do with printer locations.

Let me explain how the app works first so as you know what steps are being taken:

1) The VB 6.0 app asks the user for a destination printer using the Windows Common Dialogue Box (in Printer form). In theory (and it works on a standard desktop), this should change the Windows printer object to point at the specified printer.

2) The VB 6.0 app then sets the printer of a crystal report to the values of the Windows printer object.

3) The crystal report then prints out to the specified destination.

However, the problem arises in that the crystal report ALWAYS prints out to the default printer at the time the application is started. If the default printer is changed while in the app (ie. using the common dialogue box) then this new default printer can only be used after closing the app then restarting it.

The current printer setup is that all the printers accessible to a user are auto-created printers on the client machine. We have no printers installed on the Citrix box itself.

Can anybody tell me why the Windows printer object refuses to adjust to what the user selected? Is it because of the way Citrix makes a single-user environment into a multi-user environment which means it handles the printer object in a different way? Or is it some other reason?

Any help greatly appreciated.
 
What version of Citrix are you using?

If it is Metafram XP, check to see if your users are allowed to autocreate all of their attached printers or if they are only allowed to default to the Main Client Printer.

If you are giving your users access to a published application rather than a desktop session, Citrix has no way of knowing which of the users printers is the default if they have more than 1, if they have only 1 then that becomes the default. Have you tried testing the problem allowing a user to run the application from within a desktop session to see if they are able to make changes to the printer settings whilst running the application.
 
I have since found out that what I am trying to do cannot be done, simply because of the way Citrix handles the printer object. The theory that the application uses is fine for a standard desktop, but cannot be applied to the Citrix session, simply because Citrix has to use the Windows spooler amongst multiple users. The simplistic way that the VB application references the printer object would cause havoc if Citrix used it the same way, for example: Person A sets their printer destination using the Windows printer object. Between setting the printer object destination and spooling the printer job, Person B also accesses the printer object and sets their printer destination, different from Person A. Suddenly, Person A's print job is spooled to Person B's printer because the printer object has been changed before the spooling started.

No, I will have to find a way to access Citrix's method of spooling via the HKEY_USERS section of the registry (where Citrix obviously stores the information for the various users logged in).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top