rpt = New cryName Dim dt As New DataTable("PhoneBook") Dim dr As DataRow dt.Columns.Add("Label1", System.Type.GetType("System.String")) dt.Columns.Add("Label2", System.Type.GetType("System.String")) dt.Columns.Add("Label3", System.Type.GetType("System.String")) dt.Columns.Add("Label4", System.Type.GetType("System.String")) Try For i As Integer = 0 To dgvData.Rows.Count - 1 dr = dt.NewRow dr("Label1") = dgvData.Item(0, i).Value.ToString dr("Label2") = dgvData.Item(1, i).Value.ToString dr("Label3") = dgvData.Item(2, i).Value.ToString dr("Label4") = dgvData.Item(3, i).Value.ToString dt.Rows.Add(dr) Next rpt.SetDataSource(dt) CrystalReportViewer1.ReportSource = rpt Catch ex As Exception End Try
Catch ex As Exception End Try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)