JSFiddle - React, Tailwind, and code Playground

by Flexmonster Pivot Table

HTML

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

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

JavaScript

let pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  beforetoolbarcreated: customizeToolbar,
  customizeCell: customizeCell,
  report: {
    dataSource: {
      filename: "data/data.csv"
    },
    slice: {
      rows: [{
        uniqueName: "Color"
      }],
      columns: [{
        uniqueName: "[Measures]"
      }],
      measures: [{
        uniqueName: "Price",
        format: "currency"
      }]
    },
    formats: [{
      name: "currency",
      currencySymbol: "₹",
    }]
  }
});

function customizeToolbar(toolbar) {
  // get all tabs 
  let tabs = toolbar.getTabs();
  toolbar.getTabs = function() {
    // modify the Export tab using its id
    tabs = tabs.map(tab => {
      if (tab.id === "fm-tab-export") {
        tab.menu[3].handler = () => {
          pivot.exportTo("excel", {
            useCustomizeCellForData: false
          })
        }
        return tab;
      } else return tab;
    })
    return tabs;
  }
}

function customizeCell(cell, data) {
  //The customizeCell function added to illustrate the useCustomizeCellForData: false effect
  if (data.measure) {
    cell.text = data.label + ".00"
  }
}