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

Sign In to Post

Welcome back! Login to your account and get access to the CardExchange® Community and start posting today.

Please read our community rules!

Account Registration

Please fill in the fields below and become a member of our CardExchange® Community today!

Please enter the name!
Please provide an username!
Please provide a valid e-mail!
Retype the e-mail!
Please enter a password!
Retype the password!
After you submit your registration you will receive an email with information about your account

ISO/IEC 27001:2013 

United States

201 Sand Creek Rd, Suite L-E
Brentwood, CA 94513

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

Netherlands

Stationsplein 13 A
3818 LE, Amersfoort

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

© 2022 CardExchange, Inc.