Hi Hougth,
Thanks for contacting Syncfusion support.
We can set the parameter values to report through ReportViewerOptions in WebAPI side. The ReportViewer has parameter property that is the list of report parameter type to add collection of report parameter to it in server side (WebAPI) and also in client side (JS) as shown in below code example.
WebApi:
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
List<ReportParameter> parameters = new List<ReportParameter>();
parameters.Add(new ReportParameter() { Name = "SalesYearParameter", Labels = new List<string>() { "2003" }, Values = new List<string>() { "2003" } });
reportOption.ReportModel.Parameters = parameters;
} |
JS:
<script type="text/javascript">
angular.module('syncApp', ['ejangular']).controller('ReportController', function ($scope) {
$scope.report = true;
$scope.samplevalue = 'http://' + window.location.host + '/api/ReportApi';
$scope.path = '~/Report/Sales Dashboard.rdl';
$scope.mode = ej.ReportViewer.ProcessingMode.Remote;
$scope.parameters = [{
name: 'SalesYearParameter',
labels: ['2003'],
values: [2003]
}]
});
</script> |
We have prepared the sample and it can be downloaded from below location,
Please refer the below UG documentation for more information,
Regards,
Yuvaraj D