Custom request headers for XMLA

by Flexmonster Pivot Table

HTML

<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>

<div id="pivot-container"></div>

JavaScript

$(document).ajaxSend(function(e, xhr, options) {
  if (options.url == "http://olap.flexmonster.com:8282/icCube/xmla") {
  	// set your headers here
    //xhr.setRequestHeader('x-my-custom-header', 'some value');
  }
});

var pivot = new Flexmonster({
	container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  width: "100%",
  height: 400,
  toolbar: true,
	report: {
  	dataSource: {
			dataSourceType: "iccube",

			/* URL to XMLA service */
			proxyUrl: "http://olap.flexmonster.com:8282/icCube/xmla",

			/* Catalog name */
			catalog: "Sales",

			/* Cube name */
			cube: "Sales"
    },
    "slice": {
        "rows": [
            {
                "uniqueName": "[Customers].[Geography]",
                "sort": "asc"
            }
        ],
        "columns": [
            {
                "uniqueName": "[Product].[Product]",
                "sort": "asc"
            },
            {
                "uniqueName": "[Measures]"
            }
        ],
        "measures": [
            {
                "uniqueName": "[Measures].[Amount]",
                "aggregation": "none",
                "active": true
            },
            {
                "uniqueName": "[Measures].[Count]",
                "aggregation": "none",
                "active": true
            }
        ],
        "expands": {
            "expandAll": false
        },
        "drills": {
            "drillAll": false,
            "rows": [
                {
                    "tuple": [
                        "[Customers].[Geography].[Region].&[AS]"
                    ]
                }
            ]
        }
    }
	}
});