How to Print Data grid view values from Printer with out print preview

  • Thread starter Thread starter muhammadanzar
  • Start date Start date
M

muhammadanzar

Guest
1420301.jpg

Imports System.Data
Imports System.Data.SqlClient
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.CrystalReports

Public Class Database_value_print
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim connection As New SqlConnection("Data Source=.\SQLEXPRESS;Initial Catalog=TestA;Integrated Security=True")
Dim adapter As New SqlDataAdapter("select * from table_1", connection)
Dim table As New DataTable()
adapter.Fill(table)
DataGridView1.DataSource = table
End Sub

Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
Dim myreport As New Report
CrystalReportViewer1.ReportSource = myreport

End Sub
End Class




MUHAMMAD ANZAR E-mail : muhammadanzar@hotmail.com Mobile # :0092-3215096959

Continue reading...
 
Back
Top