Have you ever wondered how to change the Default Printer of your machine in order to redirect reports or other printed output to a specific device? Here’s a method suggested by the InduSoft Web Studio Support Department demonstrating how to change the Default Printer of your local runtime server programmatically:
— Add the following Subroutine to your global procedures:
To make this easier, we’ve included the sample text in a file: Click here for the text to change the default printer in InduSoft web Studio.
When you want to change the Default Printer, simply call the subroutine (shown above) and pass the name of the attached printer that you want to change to be the new Default Printer into the function.
For example, if you have a local printer called HP Color LaserJet 3600, and you want to make it the default printer for the machine, invoke the following VBScript statement:
SetDefaultPrinter “HP Color LaserJet 3600”
In order to use this functionality with a network printer, simply provide the qualified network name of the machine hosting the printer (or the print server) and the printer name attached to the machine.
Example: If there is a network printer attached to your machine called \\2MD31404CL-PC\HP Color LaserJet 1600, invoke the following VBScript statement in your IWS application:
SetDefaultPrinter “\\2MD31404CL-PC\HP Color LaserJet 1600”
Or you can use the IP address of the Print Server instead:
SetDefaultPrinter “\\126.96.36.199\HP Color LaserJet 1600”