Can we integrate Datatable with excel export in a SharePoint SPFX webpart?

Can we integrate Datatable with excel export in a SharePoint SPFX webpart?

SherilSheril Posts: 4Questions: 2Answers: 0

Hi,

I have been trying to integrate a datatable with excel export in SharePoint SPFx web part.
The output that I see is pretty weird.
The PDF, Export to CSV, print options are working but only excel is not working.

Answers

  • rf1234rf1234 Posts: 2,809Questions: 85Answers: 406

    If pdf, csv and print are working Excel should also work. Post a test case please or the code you are using for pdf, csv and Excel.

  • colincolin Posts: 15,158Questions: 1Answers: 2,587

    It's probably missing files. If you look at this example here, ensure you have the necessary files listed on the Javascript and CSS tabs beneath the table.

    Colin

  • SherilSheril Posts: 4Questions: 2Answers: 0

    I believe this is the issue with using jszip. I am working on SharePoint SPFX.
    Actually I am unaware of how to install jszip in an SPFX webpart

  • JonatanNGJonatanNG Posts: 2Questions: 0Answers: 0
    edited October 2020

    npm install jszip
    then in your webpart ts add the import:
    import * as JSZip from 'jszip';
    then before DataTable() call
    window["JSZip"] = JSZip;

    is not optimal but works.

This discussion has been closed.