printing the gui form

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
patgn3
Posts: 6
Joined: Tue Oct 23, 2012 3:58 am

printing the gui form

Post by patgn3 » Thu Jan 17, 2019 12:46 pm

Product, version and build: studio 2012, v. 3.1.35
32 or 64 bit version of product: 64 bit
Operating system: windows 7
32 or 64 bit OS: 64 bit

Printing. I created a gui (form) that has three columns that users input the items weights. it then does an average calculation and a standard deviation calculation. we compile the script into an executable. However, they require the results (their input included) needs to be printed for their logs.
any help or ideas are greatly appreciated.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: printing the gui form

Post by davidc » Thu Jan 17, 2019 2:18 pm

[TOPIC MOVED TO POWERSHELL GUI FORUM BY MODERATOR]
David
SAPIEN Technologies, Inc.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: printing the gui form

Post by davidc » Thu Jan 17, 2019 2:19 pm

I recommend looking at the Out-Printer cmdlet. You will have to format and pipe the data to the cmdlet.
David
SAPIEN Technologies, Inc.

User avatar
jvierra
Posts: 13677
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: printing the gui form

Post by jvierra » Sat Jan 19, 2019 8:26 pm

You can also export the data from the grid to a file. THe CSV can be easily printed by calling:

Start-Process <file.csv> -verb Print

See the attached example.
Attachments
Demo-DGVExport3.psf
(17.35 KiB) Downloaded 20 times

User avatar
jvierra
Posts: 13677
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: printing the gui form

Post by jvierra » Sat Jan 19, 2019 8:28 pm

Another method of printing is to use the "Document Print" classes.

See attached.
Attachments
Demo-PrintDocument2.psf
(16.66 KiB) Downloaded 23 times

Locked