evo14sale
asked on
printing datagrid in vb.net
i have a datagrid on my form, its datasource is from a datatable that i have created. how can i print off all the values of my datagrid??any websites that have this ?
ps: i dont want to use crystal reports and i dont want to know how to do it in c#
ps: i dont want to use crystal reports and i dont want to know how to do it in c#
sorry the previous comment was in vb6
https://www.experts-exchange.com/questions/21140536/Print-Windows-Datagrid.html?query=datagrid+print&topics=866
https://www.experts-exchange.com/questions/21140536/Print-Windows-Datagrid.html?query=datagrid+print&topics=866
Interesting link Planocz, (It refers to this question)
Sorry about that.. lol
https://www.experts-exchange.com/questions/21140536/Print-Windows-Datagrid.html
https://www.experts-exchange.com/questions/21140536/Print-Windows-Datagrid.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi again planocz,
That link was already submitted. ;-)
That link was already submitted. ;-)
Right Ron, I missed that one sorry to step on toes.
No problem planocz, there were no toes that were stepped on :-)
ASKER
Hi have the following code, it was taking from the msdn site and will print but how can i get the print preview for this?do i have to programmatically have to do this or is there a simplier way?any code wud b much appreciated
Private Sub PrintGrid_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles PrintGrid.Click
PrintDocument1.Print()
End Sub
Private Sub PrintDocument1_PrintPage(B yVal sender As System.Object, _
ByVal e As System.Drawing.Printing.Pr intPageEve ntArgs) Handles _
PrintDocument1.PrintPage
Dim myPaintArgs As New PaintEventArgs(e.Graphics, New Rectangle(New _
Point(0, 0), Me.Size))
Me.InvokePaint(DataGrid1, myPaintArgs)
End Sub
Private Sub PrintGrid_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles PrintGrid.Click
PrintDocument1.Print()
End Sub
Private Sub PrintDocument1_PrintPage(B
ByVal e As System.Drawing.Printing.Pr
PrintDocument1.PrintPage
Dim myPaintArgs As New PaintEventArgs(e.Graphics,
Point(0, 0), Me.Size))
Me.InvokePaint(DataGrid1, myPaintArgs)
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I have use the code but there is problem ...that's some rows that over char(20) dosn't show after that print
ASKER