Hi. I am using Report path in the .cs file as follows...but after exporting report, my current directory changes to exporting report and after this, generating a report an "Report Load Failed" Message coming...what should i do..
string cwd = System.IO.Directory.GetCurrentDirectory();
if (cwd.EndsWith("\\bin\\Debug"))
{
cwd = cwd.Replace("\\bin\\Debug", "\\AuditReports\\Audit.rpt");
}
else
{
cwd += "\\AuditReports\\Audit.rpt";
}
ReportDocument reportDocument = new ReportDocument();
reportDocument.Load(cwd);
Loading
Prabhu RajaPosted Nov 7, 2011, 5:22 AM
Try this one.
ReportDocument reportDocument = new ReportDocument();
reportDocument.Load(Server.MapPath("\AuditReports\Audit.rpt"));
Yadlapalli SrikanthPosted Nov 7, 2011, 12:46 AM
make sure the path is correct keep a break point and open the path via run command if it is working thn chk other issues may be database problem also effects shows empty document
your dirctory+ \AuditReports\
try this at run command and chk ur rpt file exists or not
Suthish NairPosted Nov 6, 2011, 8:37 AM
Secondly, dispose or clear all CR objects if not using.
refer
Javeed M ShaikhPosted Nov 3, 2011, 9:43 AM
can you print the output from variable cwd before the Load command and check if that is the right directly and the application has access to that directory/file.