JSFiddle - React, Tailwind, and code Playground

Export and print

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>

<button onclick="html()">Print HTML</button>

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

JavaScript

let pivot = new Flexmonster({
  toolbar: true,
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  report: {
    dataSource: {
      type: "json",
      filename: "data/retail-data.json",
      mapping: {
        Quantity: {
          type: "number",
        },
        Price: {
          type: "number",
        },
        "Retail Category": {
          type: "string",
        },
        Sales: {
          type: "number",
        },
        "Order Date": {
          type: "year/quarter/month/day",
        },
        Date: {
          type: "date",
        },
        Status: {
          type: "string",
        },
        "Product Code": {
          type: "string",
        },
        Phone: {
          type: "string",
        },
        Country: {
          type: "string",
          folder: "Location",
        },
        City: {
          type: "string",
          folder: "Location",
        },
        CurrencyID: {
          type: "property",
          hierarchy: "Country",
        },
        "Contact Last Name": {
          type: "string",
        },
        "Contact First Name": {
          type: "string",
        },
        "Deal Size": {
          type: "string",
        },
      },
    },
    slice: {
      rows: [
        {
          uniqueName: "Country",
          filter: {
            members: [
              "country.[australia]",
              "country.[usa]",
              "country.[japan]",
            ],
          },
        },
        {
          uniqueName: "Status",
        },
      ],
      columns: [
        {
          uniqueName: "Order Date",
        },
        {
          uniqueName: "[Measures]",
        },
      ],
      measures: [
        {
          uniqueName: "Price",
          aggregation: "sum",
          format: "currency",
        },
      ],
      sorting: {
        column: {
          type: "desc",
          tuple: [],
          measure: {
            uniqueName: "Price",
            aggregation:...