Skip to content

Slicers

ali-hamud edited this page Jun 27, 2018 · 17 revisions

As you may have read from the Embed Configuration Details page, you can change slicer selection when loading a report. Using slicers APIs, You can also get and set slicer state.

Slicer state

Slicer state contains the current filters applied by the slicer. Slicers support the following types of filters: 1) Basic filters 2) Basic filters with Keys. 3) Advanced filters 4) Relative date filters.

You can read more about creating filter object on Filters page.

type ISlicerFilter = IBasicFilter | IBasicFilterWithKeys | IAdvancedFilter | IRelativeDateFilter;

interface ISlicerState {
  filters: ISlicerFilter[];
}

Slicer APIs

Get Slicer state

To get a slicer state you need to find the slicer visual and call a method called getSlicerState on this visual.

visual.getSlicerState()
 .then(state => {
     ...
 });

Set Slicer state

To set a slicer state you need to create a SlicerState object, find the slicer visual and call a method called setSlicerState with the slicer state you created.

visual.setSlicerState(state)
  .catch(errors => {
    // Handle error
  });

Native slicer types

Custom slicers

Limitations