How to resolve the Routing issue in ASP.NET MVC application?
To resolve the routing issue in an ASP.NET MVC application, create all the Bold Reports® Report Viewer and Report Designer Web API methods with the ActionName and NonAction attributes. The error Multiple actions were found that matches the request occurs in the ASP.NET MVC application controller when the Web API is not routed properly with an action. Use the following code:
public class ReportApiController : ApiController, IReportController
{
[System.Web.Http.ActionName("PostReportAction")]
// Post action for processing the RDL/RDLC report
public object PostReportAction(Dictionary<string, object> jsonResult)
{
return ReportHelper.ProcessReport(jsonResult, this);
}
// Get action for getting resources from the report
[System.Web.Http.ActionName("GetResource")]
[AcceptVerbs("GET")]
public object GetResource(string key, string resourcetype, bool isPrint)
{
return ReportHelper.GetResource(key, resourcetype, isPrint);
}
[NonAction]
// Method that will be called when initialize the report options before start processing the report
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
// You can update report options here
}
[NonAction]
// Method that will be called when reported is loaded
public void OnReportLoaded(ReportViewerOptions reportOption)
{
// You can update report options here
}
}