added excel download button to the pages
2 unresolved threads
2 unresolved threads
Merge request reports
Activity
assigned to @mohammad.torkashvand
1 1 import React from 'react'; 2 import * as XLSX from "xlsx"; 3 import {ExportType} from "../helpers/constants"; 4 2 5 3 6 interface DownloadCSVProps { changed this line in version 7 of the diff
55 56 return new Blob([buffer], {type: 'application/octet-stream'}); 57 } 58 59 const DownloadDataButton: React.FC<DownloadCSVProps> = ({data, filename, exportType}) => { 60 61 const downloadData = () => { 62 let convertedData; 63 let fileType; 64 let contentType ; 65 66 switch (exportType) { 67 case ExportType.EXCEL: { 68 convertedData = convertToExcel(data); 69 fileType = 'xlsx'; 70 contentType = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8'; mentioned in commit 7104a54a
Please register or sign in to reply