Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

Expand all dimenshions

Jeremy Deats asked on April 4, 2016

Is it possible to programmatically expand all dimenshions and then have the expanded setting persisted when the report is saved/restored?

2 answers

Iryna Kulchytska Iryna Kulchytska Flexmonster April 4, 2016

Hi Jeremy,
Thank you for your question.
To expand all dimensions programmatically the following API call can be used:


API call works the best if you, for example, want to extend our default toolbar by adding a button “Expand all” that will perform this action when a user clicks it.
In case you want to have all the nodes expanded by default in the report right after it is loaded, please use expandAll and drillAll report options, as follows:

var report = {
dataSourceType: "microsoft analysis services",
proxyUrl: "",
cube: "Adventure Works",
catalog: "Adventure Works DW Standard Edition",
rows: [{uniqueName: "[Product].[Category]"}, {uniqueName: "[Reseller].[Business Type]"}],
columns: [{uniqueName: "[Measures]"}],
measures: [{uniqueName: "[Measures].[Reseller Order Count]"}],
expandAll: true,
drillAll: true

flexmonster.embedPivotComponent("", "pivot-content", "100%", "600", report, true);

In both cases, the expanded settings will be saved in the report and restored from it next time when it is loaded.
Please let me know if the answer is helpful for you.
Kind regards,

Tanya Gryshko Tanya Gryshko Flexmonster December 5, 2016

Hello Jeremy and all Flexmonster users,
After the release of version 2.3, we would like to provide you with an updated sample illustrating how to use expandAll option in report JSON:

var report = {
    dataSource: {
        dataSourceType: "microsoft analysis services",
        proxyUrl: "",
        cube: "Adventure Works",
        catalog: "Adventure Works DW Standard Edition"      
    slice: {
        rows: [
            {uniqueName: "[Product].[Category]"}, 
            {uniqueName: "[Reseller].[Business Type]"}
        columns: [{uniqueName: "[Measures]"}],
        measures: [
            {uniqueName: "[Measures].[Reseller Order Count]"}
        expands: { expandAll: true },
        drills: { drillAll: true }      
var pivot = $("#pivotContainer").flexmonster({
    toolbar: true,
    report: report,
    licenseKey: "XXXX-XXXX-XXXX-XXXX-XXXX"


Please login or Register to Submit Answer