Skip to content
Snippets Groups Projects

added excel download button to the pages

2 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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 {
  • 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';
  • added 1 commit

    • 5f74a774 - rename DownloadCSVProps to DownloadProps

    Compare with previous version

  • merged

  • Remco Tukker mentioned in commit 7104a54a

    mentioned in commit 7104a54a

  • Please register or sign in to reply
    Loading