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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to filter the data on dashboard based on current user using Dashboard Platform SDK?

The dashboard can be filtered using the current user name without the Syncfusion Dashboard Server by using one of the following two APIs:

  • Filter parameter
  • Dashboard parameter

Filter parameter

 You can filter the dashboard based on the current user by passing the current user name within the filterParameters API. Passing the parameter filters the dashboard at the initial render. To learn more about the filterParameters, follow the given link.

https://help.syncfusion.com/dashboard-platform/dashboard-sdk/how-to/apply-filter-using-filterparameters-api#passing-parameter-with-filterparameters-api

To filter the dashboard based on the filter parameter using the filterParameters API, pass the current username as shown in the following code snippet.

 

$("#dashboard").ejDashboardViewer(

            {

                serviceUrl: 'service URL',

                dashboardPath:'Path of the dashboard',

                filterParameters: "UserName=Thomas Hardy",  \\ User Name must be a column in the data Source

            }

    );

 

Find the ASP.NET MVC sample to filter the dashboard using the filterParameters API in the following link.

http://www.syncfusion.com/downloads/support/directtrac/205126/ze/Filtering_using_login_user-1220312593

In the above sample, the user name and password have been used as follows.

User Name

Password

Thomas Hardy

user1@company.com

Martin Sommer

User2@company.com

Christina Berglund

User3@company.com

Yang Wang

User4@company.com

Elizabeth Brown

User5@company.com

 

Dashboard parameters

You can filter the dashboard based on the current user by passing the current user name within the dashboardParameters API.

To know how to configure the Dashboard Parameters in the Syncfusion Dashboard Designer, follow the given link.

https://help.syncfusion.com/dashboard-platform/dashboard-designer/compose-dashboard/configuring-dashboard-parameters

Refer to the UG documentation link to learn about the Dashboard Parameter API.

https://help.syncfusion.com/dashboard-platform/dashboard-sdk/ejdashboardviewer#members:dashboardparametersettings

To know how to pass the Dashboard Parameter from the viewer, follow the given link.

https://help.syncfusion.com/dashboard-platform/dashboard-sdk/how-to/apply-dashboard-parameters-using-dashboardparametersettings-api

The following code snippet illustrates the Dashboard Parameters based on the current user.

$("#dashboard").ejDashboardViewer(

          {

                   serviceUrl: 'service URL',

           dashboardPath:'Path of the dashboard',

                   dashboardParameterSettings: {

                "showIcon":true, // to show or hide the dashboard  parameter icon

                 "data":[{                        

                         "parameterName":"UserName",   \\ Parameter Name must be same as the parameter name used while design the dashboard             

                         "showInParameterDialog":true,

                         "showInPromptDialog":false,

                         "value":" Thomas Hardy ",                        

                         }]

                },

        }

 );

 

Article ID: Published Date: Last Revised Date: Platform: Control:
8783 05/28/2018 05/28/2018 Dashboard Platform Dashboard SDK
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon 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.Close Icon