I'm developing a web application using asp.net c#. I have a designed a crystal report that will get billing details from the database once a user purchases an item from the web application.
Everything is working fine in my local system. But as soon as I uploaded my publish folder to my shared hosting area I'm facing this error.
System.Runtime.InteropServices.COMException: Invalid file name.
Below is the code that I have returned in my .cs file
generatereport(6,Server.MapPath("~/CustomerPurchaseBill.rpt");
public void generatereport(int trid, string filepath)
{
ReportTableAdapters.ReporttblAdap dp = new ReportTableAdapters.ReporttblAdap();
ReportDocument rdc = new ReportDocument();
DataTable tb = new DataTable();
tb = dp.GetData(trid);
rdc.Load(filepath);
rdc.SetDataSource(tb);
rdc.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "crReport");
//CrystalReportViewer2.ReportSource = rdc;
}