)
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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dashboard Parameters using API

Platform: Dashboard Platform |
Control: Dashboard SDK |
Published Date: December 12, 2017 |
Last Revised Date: May 8, 2019
Tags: dashboard

Applying Dashboard parameters using API

The Dashboard Platform SDK provides support to customize the dashboard parameter settings using following APIs.

  • dashboardParameterSettings,
  • openParameterDialog()
  • filterParameters

1.dashboardParameterSettings

This API is used to show or hide the dashboard parameter icon and apply dashboard parameters.

The dashboardParameterSettings has the below two inner level properties,

* showIcon

* data

Where,

showIcon: Holds the Boolean value and it is used to show or hide the parameter icon in the Dashboard Viewer.

data: Holds the array of value as shown in below table,

API

Description

parameterName

 

Name of the parameter.

showInPromptDialog

Indicates whether to show the mentioned parameter in prompt dialog, which will appear before applying the value.

 

showInParameterDialog

Indicates whether to show the mentioned parameter in parameter dialog with its default value.

 

value

Value of the parameter

 

 

Below code snippet is example for passing the value of the parameter:

$("#dashboard").ejDashboardViewer({
      serviceUrl: 'service URL',
             dashboardPath:'Path of the dashboard',
     dashboardParameterSettings: {
                  "showIcon":true, // to show or hide the dashboard parameter icon
                   "data":[{
                   "parameterName":"CustomerID",            
                   "showInParameterDialog":true,
                    "showInPromptDialog":false,
                    "value":"TRADH"
                         }]
                 },
        }
    );

 

   

The below image illustrates the above code snippet:

Based on the code changes widget rendered here

2.openParameterDialog()

This method is used to open the dashboard parameter dialog explicitly with the dashboard viewer instance.

Example

<script type="text/JavaScript">
            var dashboardObject;
            $(document).ready(function () {               
               dashboardObject = $('#dashboard').data("ejDashboardViewer");
               dashboardObject.openParameterDialog();
            });
     </script>

 

The below image illustrates the above code snippets:

Based on the code changes widget rendered here

3.filterParameters

This API is used to pass the dashboard parameter by including them in the dashboard URL.

Example:

$("#dashboard").ejDashboardViewer({
      serviceUrl: 'service URL',
      dashboardPath:'Path of the dashboard',
       filterParameters:location.search.substr(1)
});

 

To set the dashboard parameter within the URL follow the syntax,

@parameter = value

Where parameter represents the parameter name.

Here is the dashboard view illustrating the dashboard parameter in the URL.

To append your query string made with the parameter name and value to URL, add a prefix(?) to the query string like below:

http://<servername>//<culturename>/dashboards/<category>/<dashboardname>?@Parameter1=WILMK

Here is the dashboard preview that illustrates the dashboard parameter through URL.

A screenshot of a cell phone

Description generated with very high confidence

Apply the dashboard parameter for the different users in the server:

To apply the dashboard parameter

   1) Open the dashboard in the Dashboard Designer.

   2) Switch to the dashboard tab and click parameters…

The dashboard parameters pop-up will appear and in the pop-up, click add.

Click the Add option to add the parameters.

1) In the dashboard parameters pop-up, select the List as mode.

2) Select the type based on the values that you want to add.

Select the options in Dashboard Parameter window

3) Enter the values that you want to add and click add.

Select the Default value and click the Save option

4) Click save.

Now, navigate to the server tab and click user filter…

  1) User filters pop-up will appear and click add.

  2) Choose data column pop-up will appear. You can select the parameters.

Select the parameter

3) Enable the parameter that you want to select and click choose.

4) In the user filters pop-up, select the user and check the value that you want to add as parameter for the user and click ok.

Select the user and values to the user then click Ok button

Select the user and values to the user then click Ok button

 

 

 

5) Preview the designed dashboard as the user “Prince Solomon”.

6) Click the parameters icon, the prompt will appear.

7) In the drop-down, the value selected in the dashboard parameter for this user will be listed. Based on this you can filter the dashboard.

Apply filter based on the user

 

While previewing the dashboard as the user “Pavithra”, the drop-down in the prompt shows the value selected in the dashboard parameter for this user only. Based on this you can filter the dashboard. Based on the user apply filter

To show the prompt dialog while previewing, please check the option “Show Prompt” in the dashboard parameters pop-up.

Select the Show Prompt option in Dashboard parameter window

 

While previewing the dashboard, the prompt will appear where you can select the parameter value based on which the dashboard will be filtered.

Previewing the Dashboard select the Value  in Parameter.

 

 

 

 

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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

Live Chat Icon For mobile
Live Chat Icon