hungnth27
New member
Hi all, i have a project: load data from excel file to datagridview (DGV1) and I have 2 datagridview (DGV1 and DGV2). After click a row from DGV1, data row from DGV1 will be displayed to DGV2. Now, i cant display export data from DGV2 to Crystal Report. But, with this code, i try display data from DGV1, it's normal.
Can someone help me resolved?
This is my code:
Private Sub dgvExcelShow_MouseClick(sender As Object, e As MouseEventArgs) Handles dgvExcelShow.MouseClick
Private Sub TakeData()
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Can someone help me resolved?
This is my code:
Private Sub dgvExcelShow_MouseClick(sender As Object, e As MouseEventArgs) Handles dgvExcelShow.MouseClick
TakeData()
End SubPrivate Sub TakeData()
If dgvExcelShow.RowCount = 0 Or Nothing Then
Else
If dgvExcel_Row.RowCount = 0 Then
For Each cell As DataGridViewColumn In dgvExcelShow.Columns
dgvExcel_Row.Columns.Add(DirectCast(cell.Clone, DataGridViewColumn))
Next
End If
dgvExcel_Row.Rows.Add(dgvExcelShow.CurrentRow.Cell s.Cast(Of DataGridViewCell).Select(Function(c) c.Value).ToArray)
End If
End SubdgvExcel_Row.Rows.Add(dgvExcelShow.CurrentRow.Cell s.Cast(Of DataGridViewCell).Select(Function(c) c.Value).ToArray)
End If
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
dt = Me.dgvExcel_Row.DataSource
Dim Report As New CrystalReport_Test
Report.SetDataSource(dt)
Dim R As New Form2
R.CrystalReportViewer1.ReportSource = Report
R.ShowDialog()
End SubDim Report As New CrystalReport_Test
Report.SetDataSource(dt)
Dim R As New Form2
R.CrystalReportViewer1.ReportSource = Report
R.ShowDialog()