Hi smile,
You have to manually load the report in ReportDocument using the path.
For crystal report refer below article.
Change the Form1_Load event code with below.
C#
private void Form1_Load(object sender, EventArgs e)
{
Customers dsCustomers = GetData();
ReportDocument crystalReport = new ReportDocument();
crystalReport.Load(Application.StartupPath.Replace("bin\Debug","") + "AB\\CrystalReport\\rptStuData.rpt");
crystalReport.SetDataSource(dsCustomers);
this.crystalReportViewer1.DisplayGroupTree = false;
this.crystalReportViewer1.ReportSource = crystalReport;
this.crystalReportViewer1.RefreshReport();
}
VB.Net
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
Dim dsCustomers As Customers = GetData()
Dim crystalReport As ReportDocument = New ReportDocument()
crystalReport.Load(Application.StartupPath.Replace("bin\Debug","") & "AB\CrystalReport\rptStuData.rpt")
crystalReport.SetDataSource(dsCustomers)
Me.crystalReportViewer1.DisplayGroupTree = False
Me.crystalReportViewer1.ReportSource = crystalReport
Me.crystalReportViewer1.RefreshReport()
End Sub