Two problems when printing behind WAS
Author: knut.dybendahl@gmail.com (Knut)
Hi all, Problem 1; I have a form / report component (FRM1) called from a USP using activate. In FRM1 I do a print "LASER1", "A" and Uniface gives me a -400 error. LASER1 is defined as a logical printer (in USYS.INI) - and maps to a printer model LASER1 which is set up to use P_MSWINX with /nodialog and /queue=LASER1. I've changed the login of userver to use my own credentials so I'm sure I have the appropriate access rights to get to the spooler - but simply no joy... Just to be clear - I need to produce the file on the server - and return the result.... in the example above I print to a network printer / local port defined as a file - neither works. As a side issue, as I need to produce a pdf file and send that pdf file back to the browser, I've had a look at PdfCreator. Does anyone have any alternatives? Problem 2; The output contains an image loaded from a disc file. When viewing the image on screen (scaling = 100) - the image appears correct. When running in the report it's stretched beyond the size of the image field - even though it's the same component. Any ideas anyone?
7 Comments
Local Administrator
That's correct, you need to manually add/create the .ini registry entries. Hope this helps. Regards, Daniel
Author: diseli (daniel.iseli@uniface.com)
Local Administrator
Hi Daniel, At the moment I've got one logical printer defined - and I can see it in regedit under hkey_current_user\software\compuware\uniface\usys9\prt_laser and in hkey_users\s-1-5......\software\cimpuware\uniface\usys9\prt_laser1 However, I cannot see any entries \ references to any .ini file - anywhere. When I'm using procmon.exe - these are the locations userver looks in; HKU\.DEFAULT\Software\Compuware\Uniface\USYS9\usys:userver.aps\PRT_LASER1 HKU\.DEFAULT\Software\Compuware\Uniface\USYS9\PRT_LASER1 HKU\.DEFAULT\Software\Compuware\Uniface\USYS8\PRT_LASER1 HKU\.DEFAULT\Software\Compuware\Uniface\C:\Program Files\Compuware\Uniface 9.6.01\uniface\adm\USYS.ini\PRT_LASER1 HKLM\Software\Compuware\Uniface\C:\Program Files\Compuware\Uniface 9.6.01\uniface\adm\USYS.ini\PRT_LASER1 HKLM\Software\Compuware\Uniface\C:\Program Files\Compuware\Uniface 9.6.01\uniface\adm\default_ini\PRT_LASER1 HKU\.DEFAULT\Software\Compuware\Uniface\USYS9\usys:userver.aps\PRT_LASER1 HKU\.DEFAULT\Software\Compuware\Uniface\USYS9\PRT_LASER1 HKU\.DEFAULT\Software\Compuware\Uniface\USYS8\PRT_LASER1 HKU\.DEFAULT\Software\Compuware\Uniface\C:\Program Files\Compuware\Uniface 9.6.01\uniface\adm\USYS.ini\PRT_LASER1 HKLM\Software\Compuware\Uniface\C:\Program Files\Compuware\Uniface 9.6.01\uniface\adm\USYS.ini\PRT_LASER1 HKLM\Software\Compuware\Uniface\C:\Program Files\Compuware\Uniface 9.6.01\uniface\adm\default_ini\PRT_LASER1 How does the .ini registry entries get there in the first place? Manually? Cheers, Knut
Author: Knut (knut.dybendahl@gmail.com)
Local Administrator
Hi Knut, The Logical Printer definitions were always stored in the registry - only the mapping between physical and logical printer is defined in the INI file. So the "change in behavior" is a result of changes in Windows - before Windows Server 2008 the user registry hive always was present (in memory) and since Windows Server 2008 the user registry hive is unloaded when the user is not logged on locally to the system. Hope this helps. Regards, Daniel
Author: diseli (daniel.iseli@uniface.com)
Local Administrator
Hi Daniel, Thank you - I suspected it might had to do with the registry - although I haven't been able to dig into it too much. If the user is logged on (this is a W2008R2 server) - sometimes it (kinda) works - mostly not. I'll do some more digging now that you've alerted me to some of these 'pitfalls'. It raises the question though - why use the registry in the 1st instance when the ASN / INI file combination has worked well for a number of years?? Regards, Knut
Author: Knut (knut.dybendahl@gmail.com)
Local Administrator
Hi Knut, This is concerning problem 1: It might be a good idea to check with (e.g.) the Windows Sysinternals Process Monitor (http://technet.microsoft.com/en-us/sysinternals/bb896645) in which registry key the UServer is searching the logical printer definitions. There are some pitfalls you have to keep in mind when trying to print from a UServer:
Note: we are currently investigating why the UServer does not load the user registry hive correctly when the /su command line switch is used. And I've asked that the fallback registry key for the logical printer definitions is added to the documentation. I hope this makes sense. Kind regards, Daniel
Author: diseli (daniel.iseli@uniface.com)
Local Administrator
Hi Theo, Thank you for that - all checks out ok... Once I figure it out I'll post back. Knut
Author: Knut (knut.dybendahl@gmail.com)
Local Administrator
No immediate solution in mind. Maybe this diagnostic tool that I made a couple of years ago helps: http://theunifaceuniverse.blogspot.nl/2011/12/uniface-printing-on-windows.html
Author: Theo Neeskens (tneeskens@itblockz.nl)