cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Smartchart binding using CDs views with parameters

02-05-2021 9:19 AM
834 views 0 comments
0 Likes
SAP Managed Tags
Subscribe

In my XML view I have used Smartcharts with CDs views entityset and it was working as per the requirement.

Output

As per the new requirement, need to enable the parameters for the CDs views to reduce the amount of load.

I have tried Smartchart beforeRebindChart event for applying parameters.

<smartChartBeforeRebind: function (oEvent) { 
    var oBindingParams = oEvent.getParameter("bindingParams");
    oBindingParams.parameters = { "entitySet": "Z****_SERV1" };
    var aFilters = [];
    aFilters.push(new sap.ui.model.Filter("***den", sap.ui.model.FilterOperator.EQ, "ALL"));
    oBindingParams.filters = aFilters;    
    oBindingParams.events.dataRequested = (oEvent) => {
        console.log("oBindingParams.events.dataRequested: ", oEvent);
    }
    oBindingParams.events.dataRecevied = (oEvent) => {
        console.log("oBindingParams.events.dataRecevied: ", oEvent);
    }
},

After applying the parameters to the entityset the Smartcharts are not loading. An empty tile is loaded without chart. Is there any way I can apply filters to the Smartchart?

I am using oData V2 version and project is created using SAP BAS.

0 Likes

Accepted Solutions (0)

Answers (0)