We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Need to add Report parameters to my report for filtering the data

Thread ID:

Created:

Updated:

Platform:

Replies:

124343 Jun 2,2016 12:53 AM Jun 2,2016 07:31 AM JavaScript 1
loading
Tags: ejReportViewer
Hougth Trading
Asked On June 2, 2016 12:53 AM

Hi, I am working on integration of ReportViewer using angularjs module. After a lot of struggle i made it working with my code. But now i want to integrate filter parameters in the report using report parameters so that i could filter the report. I tried adding parameters in client end as well as in web api. Please let me know the solution for the same. I have attached a screenshot what i want in my report.

Attachment: Capture_52d5aaaf.zip

Yuvaraj Devarajan [Syncfusion]
Replied On June 2, 2016 07:31 AM

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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;