How to resolve the Multiple actions were found that matches the request issue when using ASP.NET MVC application
To resolve the Multiple actions were found that matches the request issue, add the ActionName and NonAction attributes to all Web API methods of the Bold Reports® Report Viewer and Report Designer controller. The issue occurs in an ASP.NET MVC application controller when the Web API is not routed properly with an action. The following code shows the attributes on each method.
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
}
}