ReportViewerForMvc PartialView exception

330 Views Asked by At

This is my _ReportViewer.cshtml partial view:

@using ReportViewerForMvc
@Html.ReportViewer(ViewBag.ReportViewer as Microsoft.Reporting.WebForms.ReportViewer, new { scrolling = "no", style = "width: 100%; border-width: 0px" })

and my MVC action returns PartialView("_ReportViewer"); which throws "THE CONTROLLER FOR PATH '/REPORTVIEWERWEBFORM.ASPX' WAS NOT FOUND OR DOES NOT IMPLEMENT ICONTROLLER." exception.

1

There are 1 best solutions below

1
Sweta Nair On

Based on the error message in the question, I think this problem is usually encountered when the area of the page you are accessing is different than the area in which the controller is placed.

Hence, I would suggest to pass the area path in controller return PartialView and try it.

return PartialView("~/Areas/your_path/_ReportViewer.cshtml", viewModel);