Solved TD-15695: SalReportSetPrinterTray does not work anymore

Report bugs and possible workarounds.
Nils Jänicke
Germany
Posts: 413
Joined: 20 Sep 2017, 11:56
Location: Villingen-Schwenningen, Germany

TD-15695: SalReportSetPrinterTray does not work anymore

Post by Nils Jänicke » 01 Jun 2011, 10:25

The printer always uses the tray defined in the report layout, using SalReportSetPrinterTray does not work like described in the help.
We use SP2 and EMP 5347

Nils Jänicke
Germany
Posts: 413
Joined: 20 Sep 2017, 11:56
Location: Villingen-Schwenningen, Germany

Re: TD-15695: SalReportSetPrinterTray does not work anymore

Post by Nils Jänicke » 01 Jun 2011, 11:08

Here is a testcase. You should change the paper tray in the SAM_ReportNotify message to a valid value of your printer.
You do not have the required permissions to view the files attached to this post.

Jeff Luther

Re: TD-15695: SalReportSetPrinterTray does not work anymore

Post by Jeff Luther » 01 Jun 2011, 18:52

I see the problem too and have added defect TD-15695 for this.

Nils Jänicke
Germany
Posts: 413
Joined: 20 Sep 2017, 11:56
Location: Villingen-Schwenningen, Germany

Re: TD-15695: SalReportSetPrinterTray does not work anymore

Post by Nils Jänicke » 03 Jun 2011, 08:40

Since the printer always uses the default tray it is not possible to install a second printer driver, change the tray there and then use this driver to print. This was the way to use paper trays in our old TD 3.1 application, but now the TD 6.0 application always uses the default tray regardless of the settings in the driver.
So this is a very important feature for us, we need a bug fix (EMP) as soon as possible. Do you have any date when this bug will be fixed?

Jeff Luther

Re: TD-15695: SalReportSetPrinterTray does not work anymore

Post by Jeff Luther » 07 Jun 2011, 01:17

You're in luck!! I see that the TD defect got fixed today and is scheduled for release with v6 SP3. I talked to the developer who fixed the bug who saw what the problem was. I asked about a workaround and he said to do this:

Call SalReportSetPrinterTray( SalNumberToWindowHandle( wParam ), RPT_PageAll, ' Tray 1' )

That is, prepend the tray name with a space. Now with SP2 it works. BUT, be aware -- make yourself a note or add a comment to your code: This will not work once SP3 is released, so when you get SP3 you will need to pass the tray name without the space in the front.

Nils Jänicke
Germany
Posts: 413
Joined: 20 Sep 2017, 11:56
Location: Villingen-Schwenningen, Germany

Re: TD-15695: SalReportSetPrinterTray does not work anymore

Post by Nils Jänicke » 07 Jun 2011, 06:31

Sorry, that doesn't work. "Error.. Invalid parameter : tray name" is the message and it doesn't work.

Jeff Luther

Re: TD-15695: SalReportSetPrinterTray does not work anymore

Post by Jeff Luther » 07 Jun 2011, 18:39

I am sorry as well! It might be a printer-specific issue. My HP LaserJet 1320 test on my Dell WinXP machine works OK with that prepended space. A fix will be coming soon.

Nils Jänicke
Germany
Posts: 413
Joined: 20 Sep 2017, 11:56
Location: Villingen-Schwenningen, Germany

Re: TD-15695: SalReportSetPrinterTray does not work anymore

Post by Nils Jänicke » 20 Jun 2011, 12:39

No. This bug is not fixed with this EMP. It always prints to the printer's default tray.
And without getting WM_KEYDOWN messages we can't use this EMP, i must go back to the last one.

Please fix these bugs as soon as possible and have again a look on the printing of RTF contents.

I am very angry. This EMP is only buggy and no one of our bugs is fixed.

Jeff Luther

Re: TD-15695: SalReportSetPrinterTray does not work anymore

Post by Jeff Luther » 06 Jul 2011, 19:41

Nils -- are you catching the Boolean return from SalReportSetPrinterTray() to see whether it is returning T or F?

BTW, I just tested with my HP 1320 by changing print to "Manual Feed" and it changes tray OK:
JL-v6SP3_SetsTrayToManualFeed-OK.png
When I ran the app. for this tray my HP laserjet went into pause mode until I put a sheet of paper in the manual feed slot. Then it printed out your sample QRP to this sheet OK. HP printer's default it 'Tray 1'.

As Ana wrote, you will need to provide us details of how this is not working for you.
You do not have the required permissions to view the files attached to this post.

Nils Jänicke
Germany
Posts: 413
Joined: 20 Sep 2017, 11:56
Location: Villingen-Schwenningen, Germany

Re: TD-15695: SalReportSetPrinterTray does not work anymore

Post by Nils Jänicke » 07 Jul 2011, 07:01

Ok, here are two screenshots of the test case running on a XP machine and a Lexmark printer.

First the program code, like described in the TD help on SAM_Notify the paper tray is changed by SalReportSetPrinterTray.
Print1.PNG
Then I stoppt the printer to see what is printet to the printer queue.
Running the example you can see at the printer document's properties that the printer does not use the choosen printer tray, it uses the printer tray defined at the QRP!
print2.PNG
You do not have the required permissions to view the files attached to this post.

Nils Jänicke
Germany
Posts: 413
Joined: 20 Sep 2017, 11:56
Location: Villingen-Schwenningen, Germany

Re: TD-15695: SalReportSetPrinterTray does not work anymore

Post by Nils Jänicke » 07 Jul 2011, 07:35

The function returns TRUE. But the printer does not use the selected paper tray. I've tested also with another printer (a RICOH Aficio MP C3000 PCL 6), it's the same result, the paper tray is not changed.

I've tested on a Windows 7 machine, same result.

Couriously on a Windows 7 machine connected by remote desktop and redirected printer driver to my XP station it worked fine.

Nils Jänicke
Germany
Posts: 413
Joined: 20 Sep 2017, 11:56
Location: Villingen-Schwenningen, Germany

Re: TD-15695: SalReportSetPrinterTray does not work anymore

Post by Nils Jänicke » 07 Jul 2011, 08:14

Seems to work on the RICOH printer, but the Lexmark printer only uses the application's trays if it is used as redirected printer on a remote desktop session. I will continue testing.
Sorry for the confusion...

Nils

Return to “Bug Reports”

Who is online

Users browsing this forum: [Ccbot] and 0 guests