Hi there,
I have an asp .net mvc application that I would like to embed report viewer in.
I have an action in my index.cshtml as follows:
@Html.ActionLink("Report", "Report", new { id = item.CUST_NO })
This page goes to the report method in the projectcontroller class:
public void Report(string id)
{
SSRSReportPage a = new SSRSReportPage();
a.btnGetReport_Click_Click(new object(), new EventArgs());
}
This then goes to the button click event in my ReportPage.cs:
public void btnGetReport_Click_Click(object sender, EventArgs e)
{
deceasedc = new FNB_DeceasedClientsController();
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://fit-rbgvdi/Reportserver");
ReportViewer1.ServerReport.ReportPath = "/COB/COB";
ReportParameter[] reportParameterCollection = new ReportParameter[1];
reportParameterCollection[0] = new ReportParameter();
reportParameterCollection[0].Name = "cust_no";
reportParameterCollection[0].Values.Add(rvalue);
ReportViewer1.ServerReport.SetParameters(reportParameterCollection);
ReportViewer1.ServerReport.Refresh();
}
I keep getting an error on
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
System.NullReferenceException; Object reference not set to an instance of an object.
Any ideas?
What I have tried:
I have tried entering a report viewer package and an object as above.