Category / Section
How to set the parameter in Web API Controller
Published:
Updated:
Use the OnReportLoaded
method to set parameter default value in the Web API controller.
[NonAction]
public void OnReportLoaded(ReportViewerOptions reportOption)
{
List<BoldReports.Web.ReportParameter> userParameters = new List<BoldReports.Web.ReportParameter>();
userParameters.Add(new BoldReports.Web.ReportParameter()
{
Name = "SalesOrderNumber",
Values = new List<string>() { "SO50756" }
});
reportOption.ReportModel.Parameters = userParameters;
}
You can find the following help documentation for how to set the parameter at client side in various platforms.