Set a relative path for crystal reports

Jun 26 2012 11:56 PM
I have written the following code,
CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
report
.Load(@"C:\Users\XXX\Desktop\Backup1\Project\ReportsFolder\ReportSalesInvoice.rpt");
Report works fine for the above code But I want to give a relative path so I can install it in several machines without changing the path. I have also tried the following paths
string loc = AppDomain.CurrentDomain.BaseDirectory;
string loc2 = Application.StartupPath;
string loc3 = Application.UserAppDataPath;
string loc4 = Application.CommonAppDataPath;
Used them as,
report.Load(loc2 + "\\ReportSalesInvoice.rpt");
But the file cannot be accessed.Please Help.

Answers (1)