Resolve Multiple Actions Error in Bold Reports ASP.NET MVC
Decorate Web API controller actions with [ActionName] and helper methods with [NonAction] in your ASP.NET MVC application to resolve the “Multiple actions were found that matches the request” error. This ensures the Bold Reports Web API routing correctly maps incoming Report Viewer and Report Designer requests to the matching action method.
Applies to: Bold Reports Report Viewer and Bold Reports Report Designer for ASP.NET MVC.
When to use this
Use this guide when the Bold Reports Report Viewer or Report Designer fails to load in an ASP.NET MVC application and throws an InvalidOperationException stating: “Multiple actions were found that matches the request.”
Prerequisites
- An ASP.NET MVC application using Bold Reports Report Viewer or Report Designer.
BoldReports.WebandBoldReports.MvcNuGet packages installed. The Report Designer also needsBoldReports.JavaScript.- ASP.NET Web API 2 attribute routing or the default route configured in
WebApiConfig.cs.
Steps
1. Open your report Web API controller
Open the Web API controller class (for example, ReportApiController.cs) that inherits from ApiController and implements IReportController (Report Viewer) or IReportDesignerController (Report Designer).
2. Decorate the Report Viewer controller
Specify the action name for each endpoint using [ActionName("...")], and exclude interface callback methods from routing with [NonAction]:
using System.Collections.Generic;
using System.Web.Http;
using BoldReports.Web.ReportViewer;
namespace YourNamespace.Controllers
{
public class ReportApiController : ApiController, IReportController
{
// HTTP endpoint - processes the RDL/RDLC report
[ActionName("PostReportAction")]
[AcceptVerbs("POST")]
public object PostReportAction(Dictionary<string, object> jsonResult)
{
return ReportHelper.ProcessReport(jsonResult, this);
}
// HTTP endpoint - returns report resources
[ActionName("GetResource")]
[AcceptVerbs("GET")]
public object GetResource(string key, string resourcetype, bool isPrint)
{
return ReportHelper.GetResource(key, resourcetype, isPrint);
}
// Not an HTTP endpoint - callback before processing
[NonAction]
public void OnInitReportOptions(ReportViewerOptions reportOption) { }
// Not an HTTP endpoint - callback after the report loads
[NonAction]
public void OnReportLoaded(ReportViewerOptions reportOption) { }
}
}
3. Decorate the Report Designer controller
The Report Designer controller implements IReportDesignerController, which exposes more public methods than the viewer. The fix is the same pattern: [ActionName("...")] on every HTTP endpoint (PostDesignerAction, UploadReportAction, PostReportAction, GetResource, GetImage) and [NonAction] on every public method that is not an endpoint (SetData, GetData, OnInitReportOptions, OnReportLoaded).
The SetData and GetData bodies below are trimmed to comments, because their storage logic does not affect routing. Keep your existing implementation, or copy the full version from the Add Web Report Designer doc.
using System.Collections.Generic;
using System.Web;
using System.Web.Http;
using BoldReports.Web;
using BoldReports.Web.ReportViewer;
using BoldReports.Web.ReportDesigner;
namespace YourNamespace.Controllers
{
public class ReportDesignerApiController : ApiController, IReportDesignerController
{
// --- HTTP endpoints: decorate with [ActionName] ---
[ActionName("PostDesignerAction")]
[AcceptVerbs("POST")]
public object PostDesignerAction(Dictionary<string, object> jsonResult)
{
return ReportDesignerHelper.ProcessDesigner(jsonResult, this, null);
}
[ActionName("UploadReportAction")]
[AcceptVerbs("POST")]
public void UploadReportAction()
{
ReportDesignerHelper.ProcessDesigner(null, this, HttpContext.Current.Request.Files[0]);
}
[ActionName("PostReportAction")]
[AcceptVerbs("POST")]
public object PostReportAction(Dictionary<string, object> jsonResult)
{
return ReportHelper.ProcessReport(jsonResult, this);
}
[ActionName("GetResource")]
[AcceptVerbs("GET")]
public object GetResource(string key, string resourcetype, bool isPrint)
{
return ReportHelper.GetResource(key, resourcetype, isPrint);
}
[ActionName("GetImage")]
[AcceptVerbs("GET")]
public object GetImage(string key, string image)
{
return ReportDesignerHelper.GetImage(key, image, this);
}
// --- Not HTTP endpoints: decorate with [NonAction] ---
[NonAction]
public bool SetData(string key, string itemId, ItemInfo itemData, out string errorMessage)
{
// Write the resource to your storage (file system, database, cloud).
errorMessage = string.Empty;
return true;
}
[NonAction]
public ResourceInfo GetData(string key, string itemId)
{
// Read the resource back from your storage and return it.
return new ResourceInfo();
}
[NonAction]
public void OnInitReportOptions(ReportViewerOptions reportOption) { }
[NonAction]
public void OnReportLoaded(ReportViewerOptions reportOption) { }
}
}
4. Verify the Web API routing template
Ensure the WebApiConfig.Register method in App_Start/WebApiConfig.cs includes {action} in the route template:
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional }
);
Result
Incoming HTTP requests such as api/ReportApi/PostReportAction, api/ReportDesignerApi/PostDesignerAction, and api/ReportDesignerApi/GetImage resolve unambiguously to their matching controller methods. The Report Viewer and Report Designer load without action routing conflicts.
Troubleshooting
Multiple actions were found that matches the request for ReportDesignerApiController
Cause: The Report Designer controller exposes several public methods that act as HTTP endpoints (PostDesignerAction, UploadReportAction, PostReportAction, GetResource, GetImage) alongside non-endpoint methods (SetData, GetData, OnInitReportOptions, OnReportLoaded). When the route maps by {action} and these methods lack explicit routing attributes, Web API cannot tell the endpoints from the helpers and reports ambiguous candidates.
Fix: Apply [ActionName("...")] with the matching [AcceptVerbs] to each HTTP endpoint, and [NonAction] to every method that is not an endpoint, exactly as shown in the Report Designer controller in Step 3. Note that IReportDesignerController has no OnInitReportDesigner method — the designer callbacks are OnInitReportOptions and OnReportLoaded.
Frequently asked questions
Why does ASP.NET MVC throw a multiple actions found error in Bold Reports?
ASP.NET Web API matches incoming HTTP requests to action methods by method name and HTTP verb. If the route maps by action and the interface methods lack explicit [ActionName] or [NonAction] attributes, Web API finds ambiguous action candidates and throws an exception.
Which Bold Reports controller methods must have the [NonAction] attribute?
Any public method that is not intended as an HTTP endpoint. For the Report Viewer, that means callbacks such as OnInitReportOptions and OnReportLoaded. For the Report Designer, also add [NonAction] to the storage methods SetData and GetData.
Which Report Designer methods are the HTTP endpoints?
PostDesignerAction, UploadReportAction, PostReportAction, GetResource, and GetImage are the HTTP endpoints and need [ActionName]. SetData, GetData, OnInitReportOptions, and OnReportLoaded are called internally and need [NonAction].
Does this issue occur in ASP.NET Core applications?
ASP.NET Core uses endpoint routing with explicit HTTP verb attributes ([HttpPost], [HttpGet]) and attribute routing (such as [Route("[action]")]), which avoids this ambiguous routing problem when configured as shown in the ASP.NET Core documentation.