I had created an application in c#.
But when i **move this appication to another drive,folder or PC.
I got error at crystal report **path. and need to change the path at every time when appication moved.
How to fix this problem.
means how to add it into c# resources so that path will be fix.
i will tried
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=ITRDB;Integrated Security=True");
ReportDocument crypt = new ReportDocument();
public ReportViewer()
{
InitializeComponent();
}
private void crystalReportViewer1_Load(object sender, EventArgs e)
{
SqlDataAdapter sda = new SqlDataAdapter("SELECT * FROM tblITReport WHERE Date between'"+fdate+"'and'"+tdate+"'",con);
DataTable dt = new DataTable();
DataSet dst = new DataSet();
sda.Fill(dst, "tblITReport");
crypt.Load(@"D:\My Project\C# Applicatin\ITReport\ITReport\ITReport\ITReport.rpt");
crypt.SetDataSource(dst);
crystalReportViewer1.ReportSource = crypt;
}
ReportDocument crypt = new ReportDocument();
public ReportViewer()
{
InitializeComponent();
}
private void crystalReportViewer1_Load(object sender, EventArgs e)
{
SqlDataAdapter sda = new SqlDataAdapter("SELECT * FROM tblITReport WHERE Date between'"+fdate+"'and'"+tdate+"'",con);
DataTable dt = new DataTable();
DataSet dst = new DataSet();
sda.Fill(dst, "tblITReport");
crypt.Load(@"D:\My Project\C# Applicatin\ITReport\ITReport\ITReport\ITReport.rpt");
crypt.SetDataSource(dst);
crystalReportViewer1.ReportSource = crypt;
}

Sagar Pandurang KapRank #606 · 4K reputationPosted Jan 16, 2018, 12:10 AM EST
Kenneth Sepheu4 reputationPosted Jun 10, 2019, 2:34 AM EDT
crystalReportViewer1.ReportSource = CRdoc;
Jignesh KumarRank #91 · 22.9K reputationPosted Jun 10, 2019, 5:16 AM EDT