YOUR ARE VIEWING ARTICLE

Using Printer Filters

Using Printer Filters

In the designer under page setup, you will see a new option under the template tab for “Printer filter”. You need to create a variable called printer which you can do by simply typing this here:

 PrinterFilterPageSetup

If the database field contains the actual printer name like below:

DatabaseRecordPrintFilter

Then you can map this variable directly to the database field:

PropertiesBoxPrinterFilter

But if the database field contains some value that you want to use to control the destination printer, such as Printer A or Printer B, then you will need to map the variable to a script.

First select the functions tab and enter a script like the one below:

def selectprinter(destination):

 i = destination

  if i == 'A':

    return 'Microsoft XPS Document Writer'

  elif i == 'B':

    return 'Microsoft Print to PDF'

  else:

    return 'Default'

You will need to replace the printer names with the real printer names as shown under Windows.

Once done it should look like this:

PrinterFilterPropertiesScript

You will need to create a variable called destination to go along with the one called printer that you created already:

PrinterFilterVariables

This should be mapped to the database field that contains the value used to calculate the printer name:

PrinterFilterMapProperties

And then you need to change the printer variable to point to the script instead of the database field:

selectprinter(destination)

PrinterFilterSetScript

Please avoid using the word printer in any other variable names or in the script as it can cause issues.

Now the printer should be selected based on the database field.

Note: When using the Printer filter, if no matching printer is found, the default Windows printer will be used.

TOPICS

CATEGORY

AUTHOR
Support Team

PUBLISHED
February 21, 2022

MODIFIED
April 26, 2022

US business only within scope

ISO/IEC 27001:2013 

United States

2010 Elkins Way, Suite 1122
Brentwood, CA 94513

Monday – Friday
9am – 5pm (EST)
+1 (925) 529 4999

Netherlands

Smallepad 32
3811 MG Amersfoort

Monday – Friday
9am – 5pm (CET)
+31 (0)20 2251 447

© 2023 CardExchange Solutions, Inc.