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>
<button onclick="exportTo()">
Export to Excel
</button>
<div id="pivotContainer"></div>
JavaScript
let pivot = new Flexmonster({
container: "pivotContainer",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
dataSource: {
data: [{
"Case Id": 1,
"CAL_DATCAL": "2020-05-15",
"Name": "John"
}, {
"Case Id": 2,
"CAL_DATCAL": "2020-05-20",
"Name": "Doe"
}],
mapping: {
"Case Id": {
type: "number"
},
"CAL_DATCAL": {
type: "date string"
},
"Name": {
type: "string"
}
},
},
options: {
grid: {
type: "flat"
}
}
}
});
function exportTo() {
flexmonster.exportTo("excel");
}