Can't get MVC Report to render
I've got an MVC 4.0 app, with a report page. I've created the report in Fast Reports, and it previews nicely. The data comes from a single MS SQL Server table.
For now, I just want a stand-alone report (ie, I don't pass any parameters to it, it just does its thing on its own, just to make sure it renders in my view).
I can get to the view in my MVC app, where the view renders. The horizontal striped bar gif appears, telling me it's calculating or rendering the report. But the report never appears. The horizontal striped bar just remains.
I think I must be missing something but I'm not sure what. Any help would be appreciated. Here is my controller code for the report page rendering:
public ActionResult WebReport()
{
WebReport webReport = new WebReport();
webReport.Width = 600; // set width
webReport.Height = 800; // set height
webReport.Report.Load(this.Server.MapPath("~/ReportLayouts/Members.frx"));
FastReport.Data.TableDataSource tds = (FastReport.Data.TableDataSource)webReport.Report.GetDataSource("Members");
tds.Connection.ConnectionString = ConfigurationManager.ConnectionStrings["MyDBContext"].ToString();
webReport.DesignReport = true;
ViewBag.WebReport = webReport;
return View();
}
For now, I just want a stand-alone report (ie, I don't pass any parameters to it, it just does its thing on its own, just to make sure it renders in my view).
I can get to the view in my MVC app, where the view renders. The horizontal striped bar gif appears, telling me it's calculating or rendering the report. But the report never appears. The horizontal striped bar just remains.
I think I must be missing something but I'm not sure what. Any help would be appreciated. Here is my controller code for the report page rendering:
public ActionResult WebReport()
{
WebReport webReport = new WebReport();
webReport.Width = 600; // set width
webReport.Height = 800; // set height
webReport.Report.Load(this.Server.MapPath("~/ReportLayouts/Members.frx"));
FastReport.Data.TableDataSource tds = (FastReport.Data.TableDataSource)webReport.Report.GetDataSource("Members");
tds.Connection.ConnectionString = ConfigurationManager.ConnectionStrings["MyDBContext"].ToString();
webReport.DesignReport = true;
ViewBag.WebReport = webReport;
return View();
}