Solution
Please note that when you print an HTML report using the Print Report VI, the VI ignores the printer name input and uses the default printer for Internet Explorer.
In order to remove the headers and footers, you need to modify this setting in the page setup for the Internet Explorer default printer as follows:
- Go to Settings >> Print >> Page setup…
- Select -Empty- from the dropdown boxes below Header and Footer
If you are not able to open Internet Explorer then you need to modify the settings using the registry keys.
Note: Manually changing your Windows registry can cause corruption and errors if you are not careful. Do so at your own risk.
For page margins, footers, and headers, Microsoft Internet Explorer gets the values from this registry key:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PageSetup.
The developer can alter the below registry entries for the printing settings accordingly:
- Header
- Footer
- Margin_Top
- Margin_Left
- Margin_Right
- Margin_Bottom
The following VI checks the previously mentioned keys regarding HTML default page setup and formatting and creates or changes them to the correct value if not already, these keys are needed for HTML reports to be generated properly so that they can be printed accordingly:
This VI targets the local user instead of the machine due to security restrictions on the local machine registry.