Link to home
Start Free TrialLog in
Avatar of evo14sale
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#
Avatar of evo14sale
evo14sale

ASKER

with print preview functionality
Avatar of Howard Cantrell
Interesting link Planocz, (It refers to this question)
ASKER CERTIFIED SOLUTION
Avatar of iboutchkine
iboutchkine

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi again planocz,

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 :-)
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(ByVal sender As System.Object, _
   ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles _
   PrintDocument1.PrintPage
   Dim myPaintArgs As New PaintEventArgs(e.Graphics, New Rectangle(New _
      Point(0, 0), Me.Size))
   Me.InvokePaint(DataGrid1, myPaintArgs)
End Sub
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have use the code but there is problem ...that's some rows that over char(20) dosn't show after that print