Skip to Content
avatar image
Former Member

call (from script) which Tray is the Paper Source to be used when printing a report.

I need to be able to call (from script) which Tray is the Paper Source to be used when printing a report.  We have several printers which have multiple trays which are 8 1/2 x 11.  Different color paper is held in each and the setup lists the trays as "auto" , "manual feed", "Tray 1", "Tray 2", etc...  I need to be able to call from script (C#) that I want it to use "Tray 5".  In the Crystal Reports if you go to [File][Print] you can see all of the Trays listed under Printer Paper  |  Source:  How can I pass this to the report from C#?

            crReportDocument.PrintOptions.PaperSource = PaperSource("Tray 5");
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 17, 2015 at 01:47 PM

    Don, You sent me an email (below) which I responded to begging for help.


    Removed, that was personal...

    I still have not heard anything.  What can I do to get help with this?

    Pat McLaughlin

    Message was edited by: Don Williams

    Add comment
    10|10000 characters needed characters exceeded

    • File extracts for me...

      Download it, extract it to a folder and then remove the .txt extension so it's a zip file again and then unzip that and it should have the whole project...

      And nothing obvious in your code. When I get a chance I'll try copying it into my main test app and see what happens.

      Don

      PS - I'll reply once again, it should have my e-mail address in it.

  • May 27, 2015 at 08:09 PM

    Hi Pat,

    See this new test app I am working on on how to set the various printer properties.

    How you convert that to a Command line tool is up to you. Try Googling on how to create a Console application that uses variables.

    For my latest version Top right corner search for KBA: 2163438

    But it looks like you are using the correct API...

    Use the Set Printer code to update the value each time.

    You could use PrintOutputController and print Page 1, 2, 3, .... and set the tray to use for each either by hard coding the ENUM for the paper tray ( dynamically actually because each printer may have a unique ENUM for each Tray ) and then send each page to the printer as a separate print job.

    How you save this info and where is up to you...

    Don

    Add comment
    10|10000 characters needed characters exceeded