I'm trying to implement SSRS viewer in MVC. After alot of pain and suffering I've got this basically working via a custom control.
The report renders fine, but I'm trying to pass in the Model to the control like this:
@Html.Partial("VendorReport", Model)
To call this ascx control:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VendorReport.ascx.cs" Inherits="ExtendedServicesReportingPortal.Views.Reports.VendorReport" %>
<uc1:RazorReportViewer ID="VendorReportViewer" runat="server" ...Omitted Custom Properties... />
But I'm getting this error if I try and access the Model:
The ViewUserControl '~/Views/Reports/RazorReportViewer.ascx' cannot find an IViewDataContainer object. The ViewUserControl must be inside a ViewPage, a ViewMasterPage
Here's the relevant controller controller method:
public ActionResult TransactionCountsAndInvoiceAmounts(TransactionCountsAndInvoiceAmountsModel model)
{
if(model == null) model = new TransactionCountsAndInvoiceAmountsModel();
return View(model);
}
Very new to MVC, what am I missing out?