Hi @Megha Chourasiya ,
You need to save it and then load it using its path.
using System;
using System.Drawing;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.ReportSource;
using CrystalDecisions.Windows.Forms;
namespace myapp
{
public partial class tstfrm1 : Form
{
public tstfrm1()
{
InitializeComponent();
ReportDocument rptDoc = new ReportDocument();
rptDoc.Load(@"C:\CrystalReport1.rpt");
/*If you have a datasource, link it like below*/
//rptDoc.SetDataSource(dataset.Tables["tripsheet"]);
CrystalReportViewer crystalReportViewer1 = new CrystalReportViewer();
crystalReportViewer1.ReportSource = rptDoc;
crystalReportViewer1.Refresh();
this.Controls.Add(crystalReportViewer1);
crystalReportViewer1.Dock = DockStyle.Fill;
}
}
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
ChaoDeng