01-21-2015 07:23 AM
Hi,
We recently got new printers and a printer setup on our server that are set to print in greyscale as a default. In the past the printers defaulted to printing in color. When I create VI's and reports I have used to set "Print on completion" or the print option from the Report Generation Toolkit, and I have received my prints in color. After changing the printer drivers on the server any printing method I used to do from LabVIEW will always produce greyscale prints. These prints are fine for everyday use, however we need color prints when the documents are for customers or for other official use.
If I could only send documents/VI's to that process the user could override the "greyscale" setting and select "color" in the cases where we need a better looking print. Obviously the other option is to save the document/VI as a file and later print it from any windows software (Excel, Paint etc.).
Do anyone have any neat tricks for printing using the windows printer dialog?
01-22-2015 01:39 AM
You can change printer settings programmatically via a .NET assembly. You can also bring up the Print Dialog to change settings manually before printing.
More info on the .NET assembly for colour settings here:
https://msdn.microsoft.com/en-us/library/system.drawing.printing.pagesettings.color(v=vs.110).aspx
An NI KB link on calling a print dialog:
http://digital.ni.com/public.nsf/allkb/80DD23A28BD8ADF9862575AC0077B1BB?OpenDocument
01-22-2015 02:15 AM
Thank you!
I have been studying the NI KB link. However, when I tried to run the code I got an error regarding the VI Reference to Win32Windows Reference. I have no prior experience with .NEt and can't see how I am to fix this issue when the error states that "The specified .NET class is not available in LabVIEW. " Error 1386. It's a constructor node Called WindowWrapper which take a win32 windows handle and returns a reference that in turn should be converted to a .NET reference.
01-22-2015 02:31 AM
Haven't used that myself, but you'll probably need to create your own class for the WindowWrapper part.
This document describes the process, but not having any prior experience in .NET might mean it's not very helpful!
http://digital.ni.com/public.nsf/allkb/1B733F0C719BF70386257372002F847D
I have in the past set printer settings programmatically (or at least try to, as I have to fight against a sysadmin script that keeps changing them on me) so that's probably an easier route.