Sorry if this has already been answered. I checked other threads and I didn't really see a definitive answer to the problem.
When running my application and attempting to view a report I am receiving the error "the report filename was empty". I am using VS 2010 SP1 with SAP Crystal Reports, version for Microsoft Visual Studio version 13.0.15.1840. My Crystal Reports used to be an older version (13.0.2000.000), recently upgraded it.
The reports have always worked but at some point something changed and now I'm getting this error both on my local machine and my development server. Not sure if this happened when i updated the CR for VS or not.
When I run the application it always breaks at the .load() method.
override protected void OnInit(EventArgs e)
{
base.OnInit(e);
String rootPath = Server.MapPath("~");
if (Session[FCCConstants.SESSION_FCC_ID] == null)
{
Response.Redirect("~/NeedYouthInfo.aspx");
return;
}
String fccnum = Session[FCCConstants.SESSION_FCC_ID].ToString();
int fccNumber = Int32.Parse(Session[FCCConstants.SESSION_FCC_ID].ToString());
string reporttype = Request.QueryString["Reporttype"].ToString();
DataTable dt = null;
DataSet dsTablesBirthHistoryRpt = null;
int noteType;
switch (reporttype)
{
case "Birthhistory":
dsTablesBirthHistoryRpt = Passport.GetYouthBirthHistoryInfo(fccNumber);
dsTablesBirthHistoryRpt.Tables[0].TableName = "MPBirthDT";
CrystalReportSource1.ReportDocument.Load(rootPath + "\\" + "Reports\\MP_Reports\\MPBirthThruEarlyChildhood.rpt"); <--FAILS HERE
CrystalReportSource1.ReportDocument.Subreports[0].SetDataSource(dsTablesBirthHistoryRpt);
Utils.ExportToPDF(CrystalReportSource1, Response);
break;
}
The path is correct to the report. All the reports in the application fail at the same location. CrystalReportSource1.ReportDocument.Load(rootPath)
Any suggestions?