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. Image for the cookie policy date

Restrict filter values based on filter values provided in control configurations

Hi All,


We have a multi-tenant OLAP database and we have a structure of companies and unit office assigned to company. Each company has separate users with access to various units and we have users with access to multiple companies.
I am using
msmdpump.dll to expose OLAP to web endpoint.

As suggested in this thread, this can be done using setting up role in connection string. But we have a large no combination for company and unit office, so it is next to impossible create this large no of roles in the SSAS.

https://www.syncfusion.com/forums/132514/filtering-dimesnsions-and-authentication

What we need to achieve is to restrict the user from viewing companies and units in the filter other than specified in the filter. I don't want user to see list of all the companies/units in the control.

Also not necessary, but is it possible to have some filters to be changeable and some to be fixed by configuration.
Also can we have a look at source code for https://bi.syncfusion.com/olap/msmdpump.dll

Thanks


3 Replies

AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team January 4, 2023 01:18 PM UTC

Hi Rohit,


We have some clarifications about your queries. And we listed it below.


  1. Please refer the documentation below and let us know whether you are using the EJ1 Pivot Table or EJ2 Pivot Table?

EJ1: https://help.syncfusion.com/aspnet-core/pivotgrid/getting-started#olap

EJ2: https://ej2.syncfusion.com/aspnetcore/documentation/pivot-table/olap

  1. Do you want to restrict the dimension from the fieldlist/groupingbar or the members of the dimension from the member editor dialog? Please refer the below screenshots.




  1. Do you mentioning the filterSettings or filter axis in the below lines?


Regards,

Angelin Faith Sheeba



RO rohit January 4, 2023 11:27 PM UTC

Hi Angelin Faith, thanks for the reply.

  1. I am using Syncfusion.EJ2.PivotView 
  2. Do you want to restrict the dimension from the fieldlist/groupingbar or the members of the dimension from the member editor dialog?
    Ans. I want the users to see all the dimensions, but let's say I have a user which has permission to see data from Australia And Canada only but not from France or Germany.

    I want to hide the  France or Germany member from the filter UI so that the user cannot select  France or Germany from the filters. I will pass the allowed countries using filter settings.

    Please let me know if there is a better way to define countries available to users?
  3. Do you mentioning the filterSettings or filter axis in the below lines?

    Ans. 
    Yes I mentioned the filtersettings. 

    Please refer the following code.
  4. <e-filters> 
    <e-field name="[Customer Geography].[Country]" caption="Country"></e-field>
    </e-filters>
    <e-filtersettings>
    <e-field name=" [Customer Geography].[Country] " items="Australia,Canada" levelCount=3></e-field>
    </e-filtersettings>

    These settings are for 
    ejs-pivotview control. I will set countries that I want to allow to a user in the filtersettings.



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team January 5, 2023 10:48 AM UTC

Hi Rohit,


Using MemberEditorOpen event, you can show desired members in the filtering dialog UI based on your need. Please refer the below code example.


Code Example:

function memberEditorOpen(args) {

        if (args.fieldName == '[Customer].[Customer Geography]') {

            args.fieldMembers = args.fieldMembers.filter((key) => {

                return (key.name == 'France' || key.name == 'Germany')

            });

        }

    }


Screenshot:

Meanwhile, we have prepared a sample for your reference.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/PivotTable1044403207


Also, please refer the following documentation for more details about “MemberEditorOpen” event.


Document: https://ej2.syncfusion.com/aspnetcore/documentation/pivot-table/filtering#membereditoropen


Please let us know if you have any concerns.


Regards,

Angelin Faith Sheeba


Loader.
Up arrow icon