06-23-04, 04:48 #1Registered User
- Join Date
- Jun 2004
Unanswered: tray selection from Paradox 10 to HP4300
This piece of code allowed me to nicely select printer trays using radio buttons. This worked fine for HP laserjet 5, but our HP4300 laserjets do not react on this, so windows defaults are used.
I have got 3 questions:
- Does anyone have any hints on how to solve this for HP4300?
- I figured out the strings which worked for laserjet 5 to put into repInfo("Papersource"), namely 'Tray 1', 'Tray 2' or 'Tray 3'. Does anyone know how paradox converts this to HP printer language. Were could I find documentation on what strings to use?
- Is it maybe possible to sent escape sequences from Paradox straight to the printer to solve this tray selection problem?
Thanks very much for your help.
method pushButton(var eventInfo Event) var strReportName String ;// tmp handle to report name rHandle Report ;// tmp handle to report being opened m menu repInfo dynArray Anytype; in plaats van ReportPrintInfo endVar if FileName.Value = "" then msgInfo("No report is selected.","No report is selected.") else ; Assign report file name strReportName = ":sisCommonFiles:" + FileName.Value if not isFile(strReportName) then ; check if file exists msgInfo("Sorry, no such file found.","Sorry, no such file found.") else libSIS.cmSetRptFileNameOfReport(FileName.Value) libSIS.cmSetRptNameOfReport(ReportName.Value) ; first, set up the repInfo record with settings for printing repInfo["nCopies"] = 1 repInfo["paperSize"] = prnA4 repInfo["name"] = strReportName repInfo["orient"] = libsis.cmGetOrientation() repInfo["paperSource"] = libsis.cmGetTray() ;// this can be either 'tray 1' or 'tray 2' or 'tray 3' rHandle.print(repInfo) endif endif formReturn(FALSE) endMethod
06-23-04, 13:39 #2Registered User
- Join Date
- Aug 2003
- Bologna - Italy
1) Have you got SP3? It solves TONS of print related bugs, i think also about tray selection.
2) libSIS.cmSetRptFileNameOfReport, libSIS.cmSetRptNameOfReport, libsis.cmGetTray() are call to functions in libraries of yours, you should also post these functions, especially libsis.cmGetTray(), if you want us to debug them!
3) Have you tried using ReportPrintInfo structure instead of DynArray form of report.print()?
No, you can't send escape codes to the printer via standard ObjectPal. Surely you can call Win32 API from within OPAL to set the default printer or default tray to what you want, print with pdox then return all to previous settings; Consider Pdox works, as all windows apps, at a totally device independent level, so no escape codes could be sent to the printer.The only failure is not trying to do it.
07-02-04, 04:41 #3Registered User
- Join Date
- Jun 2004
Thank you for your response. I have been ill a few days that is why I react a little late.
1) I installed SP3 but to no avail...
2) You are right: I should have sent you the function libsis.cmGetTray(), but debug I have used the strings "Tray 1", "Tray 2" or "Tray 3" instead of the function call to my library and did not have any luck. The function does the same thing.
3) The ReportPrintInfo structure does not allow for tray selection as far as I know.
If you have got any experience with using Win32 api from ObjectPal then could you give me some hints. I am desparate.....
Thanks a lot, Xerma.