Print Report VI Uses Wrong Printer When Printing HTML Reports

Updated Jul 28, 2022

Reported In

Software

  • LabVIEW
  • LabVIEW Report Generation Toolkit

Issue Details

I have an application that uses Print Report VI. However when I wire the name of the printer, it's not sending the report to the correct printer. Even if I change the default printer the report is sent to the incorrect printer.
What can I do?

Solution

There are two options to solve the problem.
 
  1. Change the default printer, either manually or programmatically using the attached LabVIEW code.
  2. If your default printer is changed by your LabVIEW code, but the behavior is the same, then this is an Internet Explorer bug. This can be fixed by adding a registry key.

In order to add registry key perform the below steps:
  • Open the registry-editor by pressing Windows+R and typing regedit into the dialog window. Then the registry editor should open.
  • Navigate to the following registry location: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
  • On the Edit menu, point to New, and then click String Value.
  • Type AlwaysUseDefaultPrinter, and then press ENTER.
  • On the Edit menu, click Modify.
  • Type yes, and then click OK.
Now, you will able to change the default printer, and also set it back as it was.

Additional Information

Print Report VI ignores the input and uses the default printer for Internet Explorer.