Hi Maximus,
Please find the attached Printing a Front Panel object instead of the whole Front panel example.
You have several possibilities in LabVIEW to print out the front panel. This example program shows a way to print only one of the front panel objects in this case a graph. The llb contains a top level vi which generates and plots 20 random data points into a graph and a subvi that prints the graph if it is chosen to do by a pop-up.
This subvi uses standard Report Generation vi's of LabVIEW to create a report, appends the image of the graph to it using its reference and then prints the report.
There is another similar example that will allow you to print particular controls instead of entire front panel, and you can download it from the following page:
Printing Front Panel ObjectsThe other attached example, Display Windows Print Dialog Using ActiveX, shows how to open a Windows Print Dialog using the Activex component "Microsoft Common Dialog Control 6.0 (SP3) Version 1.2", retrieving the number of pages to be printed and the orientation of the page selected by the user and print an example page using Report Generation VIs.
To run this example, you need to download the specific llb in attachment for you LabVIEW version ( "Print Window Example.llb" for version 6.0.X and "Print Window Example v6.1.llb" for version 6.1) and the file "Report_printer.jpg" on the same directory. When you execute the program, you can select the printer and to print or not the image.
The program structure is based on first open the Printer Dialog to ask the customer how many pages to be printed and if it will be in landscape or portrait format. After that, it will specify this configuration on the VI that will print. This VI uses technology based on Report Generation Activex component shipped with LabVIEW.
This Activex Component also can be used to perform other common dialog box as Open, Save, Color, Font and Help. Please check the Microsoft Developer Network (MSDN) to have more information in how to use this other dialogs.
If you are just interested to have this functionality, I also created another VI ( Printer Demo v6.1.llb) that separates the Activex Components used in the Print Dialog and the printer commands. So, you can just open the Demo VI and move the sub-VI into your program. Just remember that you must have the Activex component specified above.
Zvezdana S.
National Instruments