Hi Marcel,
with my suggestion you don't do anything special to print from the correct tray, no tray info in the report file and no special functions are required. The clue is to install the same printer many times and use different names. Then you configure these 'virtual' printers with different trays using the Windows Printer settings.
>>there are many ways, but I prefer to set up more 'virtual printer', each virtual >printer with a different setup. Then before the report I issue SET PRINTER TO NAME >myPrinterTray1.
>
>Thank TORE
>Yes but everything get print to the same tray,
>What I try to do is inside the report writer.
>
>that example does not work but this is the way I will like to do it.
>Exp: IIF(mytable.tray=3,BinSelect(3),BinSelect(4))
>
>Procedure BinSelect
>PARAMETERS pTrayNumber
>LOCAL lcTRay
>do case
> case pTrayNumber = 1
> lcTRay = '&l251H'
>
> case pTrayNumber = 2
> lcTRay = '&l252H'
>
> case pTrayNumber = 3
> lcTRay = '&l253H'
>
> case pTrayNumber = 4
> lcTRay = '&l254H'
>endcase
>return lcTRay