print different page of a report on different printers

cfvcfv Member Posts: 19
Hello,

I want to print a report in this way :
- the 1st page on a printer
- the other pages on another printer.

I've tried to do it with the function rundll32 printui.dll but it doesnt work.
Is there another solution ?

For example :
WshShell.Run(STRSUBSTNO('rundll32 printui.dll,PrintUIEntry /y /n"%1"',PrinterName1));
and then in an another section
WshShell.Run(STRSUBSTNO('rundll32 printui.dll,PrintUIEntry /y /n"%1"',PrinterName2));


Thank you in advance.

Comments

  • cfvcfv Member Posts: 19
    Thanks.
    but I want to change the printer, not the tray.
  • KYDutchieKYDutchie Member Posts: 345
    Hi,

    That is going to be hard to do with only one report object.
    What I would do is create a copy of your report and make that copy print all pages except the first page.

    Now you have to be careful with the preview mode:
    1. When you are in preview mode the original report will print everything.
    2. Then when you are NOT in preview mode the original report will only print the first page and call the copy with the records filtered and request form turned off.

    Finally you would need to add the new copy report to the "Printer selection" table so it will use the secondary printer.

    Hope this helps,

    Willy
    Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    I fought with this for ages a few years back, and never got it to work, even getting multiple trays to work was never reliable. In reality though the need was driven by a bad business practice, (i.e. the need for lots of paper) so after a lot of fighting I finally convinced the client to fix the business process.

    but if you ever do get this to work (with out the multiple report option) please post the solution.
    David Singleton
  • cfvcfv Member Posts: 19
    so there is no ideal solution... what a pity !
    It's also so difficil to identify the tray number of a printer !
    Each time a user is changing of printer, we have to find what number tray to use !
    I thus thought that by using 2 printers it would be simpler...

    Thanks a lot.
  • vaprogvaprog Member Posts: 1,139
    Maybe a PDF printer can help you here.

    e.g. FreePDF provides an option to pre- and postprocess PDF files generated using an arbitrary command or script, so you could print the file twice (pg 1 and pg 2..) and then delete the file.
    The site is in German, it provides a link to Babel Fish for site translation.
    The program itself is translated to 16 languages.

    There might be better options in your case, maybe automation with PDFCreator.
  • cfvcfv Member Posts: 19
    Finally I am going to use another method and use the papersource property.
    I found an example of code (in VB) which allows to identify tray's numbers.
    http://support.microsoft.com/kb/194789
    It works well and facilitates my task !
Sign In or Register to comment.