Are Subreports supported?

Oct 31, 2016 at 10:00 PM
I really like and want to make use of this. Nice work!

However, I'm attempting to present a report that contains subreports. However, the SubreportProcessing event never seems to be raised. Is there a different way to handle this use case in ReportViewer for MVC?

I've tried several things, but here's the cleanest attempt:

CONTROLLER CODE
     public ActionResult Index()
        {
            var reportViewer = new ReportViewer();
            reportViewer.ProcessingMode = ProcessingMode.Local;

            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\Bundle.rdlc";
            reportViewer.ProcessingMode = ProcessingMode.Local;
            reportViewer.SizeToReportContent = true;
            reportViewer.Width = Unit.Percentage(100);
            reportViewer.Height = Unit.Percentage(100);
            reportViewer.LocalReport.SubreportProcessing += LocalReport_SubreportProcessing;

            ViewBag.ReportViewer = reportViewer;

            return View();
        }

        private void LocalReport_SubreportProcessing(object sender, SubreportProcessingEventArgs e)
        {
            if (e.ReportPath.Contains("Subreport"))
            {
                using (var db = new Entities1())
                {
                    var data = db.TestData.ToList();
                    var datasource = new ReportDataSource("Subreport", data);
                    e.DataSources.Add(datasource);
                }
            }
        }
Jan 24 at 12:20 PM
Was this ever resolved? I have the same problem and would really like to use this solution.