Visual Basic Development Bookmark and Share   
 Home > Visual Basic Power Packs > grid view printing
 

grid view printing

hi, this is amit, i m making a window software with using microsoft visual studio 2008, there i load some data from database in grid view, i want to print it with the help of printer ,,, what should i do for doing this.

i m waiting for ur suggestion

thanking you all

amit pathak  Sunday, September 13, 2009 8:21 PM

If you just need to print the form as a screen shot. You can use the Microsoft.VisualBasic.PowerPacks's PrintForm control like this.
From the Toolbox, locate the Visual Basic PowerPacks tab and expand it, find the PrintForm control and drag drop to the form.
Add a button to the form. Add an event handler to the button to do this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Me.PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview, try the preview first.
Me.PrintForm1.Print()
End Sub

If you want to Print more data, then there is a lot thread on the forum to refer to:
Like:
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/4a3ac790-90d7-47e8-8e2e-fe504c1bbbd6/

HTH


John Chen -- See my team blog: http://blogs.msdn.com/vsdata. All my posts are provided "AS IS" with no warranties, and confer no rights.
John Chen MS  Tuesday, September 15, 2009 2:55 AM

If you just need to print the form as a screen shot. You can use the Microsoft.VisualBasic.PowerPacks's PrintForm control like this.
From the Toolbox, locate the Visual Basic PowerPacks tab and expand it, find the PrintForm control and drag drop to the form.
Add a button to the form. Add an event handler to the button to do this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Me.PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview, try the preview first.
Me.PrintForm1.Print()
End Sub

If you want to Print more data, then there is a lot thread on the forum to refer to:
Like:
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/4a3ac790-90d7-47e8-8e2e-fe504c1bbbd6/

HTH


John Chen -- See my team blog: http://blogs.msdn.com/vsdata. All my posts are provided "AS IS" with no warranties, and confer no rights.
John Chen MS  Tuesday, September 15, 2009 2:55 AM

You can use google to search for other answers

Custom Search

More Threads

• Rich textbox error when scrolling
• PowerPacks 2.0 and 3.0
• values being ignored
• Friend WithEvents PrintForm1 As <unrecognized type>
• Datarepeater - frustrating!
• Installing VB6 application on Windows Vista
• Component like ActiveLock for Visual Basic 2005 Express Edition
• lines and shape containers
• Using PrintForm for a scrolling DataGridView
• PrintForm v2.0