Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Public Class Form10
Dim Rpt As New ReportDocument
Private Sub btn_rpt1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_rpt1.Click
Dim frmView As New Form3
Rpt = New CrystalReport1
If Rpt.Rows.Count > 0 Then
MsgBox("There is no data to show in report!")
Exit Sub
End If
Rpt.Refresh()
frmView.CrystalReportViewer1.ReportSource = Rpt
frmView.CrystalReportViewer1.RefreshReport()
frmView.Show()
End Sub
Private Sub btn_rpt2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_rpt2.Click
Dim frmView As New Form3
Rpt = New CrystalReport2
If Rpt.Rows.Count > 0 Then
MsgBox("There is no data to show in report!")
Exit Sub
End If
Rpt.Refresh()
frmView.CrystalReportViewer1.ReportSource = Rpt
frmView.CrystalReportViewer1.RefreshReport()
frmView.Show()
End Sub
End Class