Can a parameter in crystal report be used to select a printer

SOLVED

We have a parameter in our Sales Order form that changes what is printed based on the parameter.  I would like to have it print to a particular printer based on the parameter selected.  Actually I want to print from a particular tray in printer based on parameter, but thought that having a printer setup for one try and another printer for the other try would be easier.  Can this be done?  Thanks for any help. 

  • 0
    SUGGESTED

    Set up virtual printers pointed to the same port with the configuration required set as the system default, may also need to have the user set the user default for each at least once if reusing the same printer name for one of the tray configuration but i recommend naming the printer accordingly so the user knows which configuration they will get when selecting printer. 

    I did this for someone who had the same printer but wanted to print to it in black and white 80% of the time and color for the other 20%, so two printers named accordingly pointing to the same port with different defaults did the trick.

  • 0

    If you want to change content in a report based on which printer is printed to, Use multi form and enter the shadow text a unique value for each printer you want a copy to go to. Then in the form you would change your content based on the shadow text value. This does not change the content based on the printer as much as it does the form copy but by setting that printer to that form copy, it will product similar results. 

  • 0

    Thanks David but the printer setup is not my issue as I already have them setup.

    T-Man, I want to have the Parameter choosing the printer not the user selecting it.  The only way you can select the printer is if you do preview

    Sales Order Printing

    Paperless Office Output:  "Print/PDF All" or Print All

    Click "Print" button

    Window for Parameter Value pops up and select "Work Order" or "Packing Slip"

    Now when then crystal report prints I want to have the tray for the printer selected based on the Parameter that was selected.

  • 0 in reply to gseales
    SUGGESTED

    As far as I know, this can not be done with Crystal Reports. When it starts to build the layout of the form it does so based on the printer that was selected by the OS. I do not think it can dynamically change the printer and reformat once it has already started this process. Here is some info for you about Crystal and Printing https://archive.sap.com/documents/docs/DOC-57979

    From the sounds of it, you would just change the form code. By default you will have standard. Change that to one you call Work Order and default the printer to the one you want to use. Do the Same for Packing Slip. I like to use Multi-Part to make sure it goes to the same printer/tray each time.

  • +1
    verified answer

    When you set up Multi-Part printing, the "Shadow Text" value is passed into the report (as a formula field).  Use this to suppress / print each section, according to when you want either copy to print.

  • 0

    I was typing  a different response while testing it at same time seem to have got it to work although not sure, since I never used multi-part before.   I selected multi-part and selected 1 copy, collated, print shadow for "Work Order' and selected the printer setup to tray 2 with white paper.  The next line in Multi-Part I setup 1 copy, collated, print shadow for "Packing Slip" and selected the printer setup to tray 3 with yellow paper.  I clicked print and the parameter window appeared and I selected "work order" and it printed the work order to white paper, then the parameter selection was on the screen again.  I selected "Packing Slip" and son of a gun it printed to tray 3 on yellow and then the parameter window was gone.

    So using Multi-Part Form was the answer.  Thank you T-Man and Kevin M.

    I think I am definitely going to recreate this report to use the shadow text to suppress the different sections instead of the parameter.  So then if I use the Shadow text, instead of the parameter, both pages will just print when you click the print button which will be once less click.  :-)  Actually it ends up being like 8 clicks  less since in preview we were selecting the parameter, printer, print, parameter, printer, print.  

  • 0 in reply to gseales

    Yes, that is exactly the strategy we use, with the Shadow Text driving the different output, which go to different printers / trays, all with a single print action.

    I believe you need to enter the Multi-Part options (and ShadowText) once per user / workstation (case sensitive) but it works well.

  • 0 in reply to gseales

    If you use paperless, remember that it will not have any shadow text. So if you account for that, you can have the copy the user gets emailed specific to that function as well. So that would give you the sales order, the picking sheet and a customer communication all with one click to print.

  • 0 in reply to T-Man

    T-Man I just want to make usre I have this correct.  Right now with the reports setup to still use the parameter and using multi-part, the paper prints out fine but the PDF of sales orderhas no pages.  I will make another crystal report to use the shadow text option instead of the parameter, but I want to make sure that when I do that, will I be able to use the "Print/PDF All" option and get the paper printout of the 2 options I put in the multi-part and the PDF of the sales order?

  • 0 in reply to gseales

    yes you should be able to have all of it working when you use the parameters. Each time it runs 1) Part 1 Sales Order 2) Part 2 Picking Sheet 3) Paperless, Crystal reports is running the report again. When it is a variable it is all passed to it. If it prompts then it may fail on one or all of the reports depending on how you are running it.