Import XLSX in React Wijmo FlexSheet

Posted by: bilal.shafi on 30 March 2018, 1:52 am EST

  • Posted 30 March 2018, 1:52 am EST

    Hey there!

    I am trying out an evaluation version of Wijmo and planning to purchase it and apply it for my client’s Spreadsheet application.

    However a necessary feature I need is the support of importing Excel sheets into my FlexSheet React component.

    I have tried out wijmo.grid.xlsx and wijmo.xlsx but they work with DOM manipulation unfortunately.

    Is there a workaround now or a fix expected in future?

    Thanks

  • Posted 2 April 2018, 3:37 am EST

    Hi,

    Thank you for evaluating Wijmo.

    Could you please elaborate a bit on the issue ( Performance or any other issues) that you are facing with DOM manipulation. Also please feel free to share exactly how you would like this feature to be implemented for React.

  • Posted 3 April 2018, 3:37 am EST

    Thanks abhishek.dutta for you reply!

    I need to know whether wijmo.react package will include wijmo.grid.xlsx or wijmo.xlsx in future?

    Is there a workaround for that in React right now? (convert excel sheet to wijmo compatible format)

  • Posted 3 April 2018, 7:10 am EST

    Hi bilal,

    the wijmo.grid.xls is independent of any Framework like Angular/React etc. It can be used on any frameworks without needed to port it. Can you please let me know the issues that you are facing with React when you try to import an XLSX file.

    In case you haven’t checked out the Import/Export functionality then I would suggest you to run through it from here ( scroll to the bottom section)

    http://demos.wijmo.com/5/React/FlexSheetIntro/FlexSheetIntro/

  • Posted 3 April 2018, 10:16 am EST

    Thanks a lot for your help!

    Can you provide me with a working sample React code that simply imports an Excel sheet and renders it into react component? I have tried the method mentioned in above example but it breaks the code.

    ES6 optimized imports format will be preferable if you please?

    Thanks

  • Posted 4 April 2018, 5:45 am EST

    Hi,

    Please refer to following sample that implements export/import to/from excel files.

    https://stackblitz.com/edit/react-cc5361

    Let me know if you still face any issue.

  • Posted 4 April 2018, 8:52 am EST

    Thank you so much!

    I’ll check this out and get back to you!

  • Posted 5 April 2018, 4:20 am EST

    Hey there!

    Every thing works fine except JSZip part. When I try to select on a file and click on Load I face the following issue: ```

    Uncaught TypeError: JSZip is not a constructor

    
    Even though I have included npm package [b]jszip[/b] and imported that using
    
    

    import JSZip from ‘jszip’

    
    and then using this in constructor:
    
    

    window.JSZip=JSZip()

    
    also tried:
    
    

    window.JSZip=JSZip

    
    yields the same error.
    
    Can you kindly provide a fix to that?
    Thanks!
  • Posted 5 April 2018, 6:19 am EST

    I fixed the JSZip part by adding a reference to JSZip 2.5 in my HTML template file.

    Thanks!

    Now I want to read an Excel sheet from server on component load. I can’t find a method to do so, all they do is provide the capability to select file and upload it.

    Is there a way I can’t render an excel sheet on component load without user interaction?

  • Posted 5 April 2018, 2:47 pm EST

    You need to pass a Blob object to the flexGridXlsxConverter Method if you want to load on initialization. Please check the sample out in this post.

    https://www.grapecity.com/en/forums/wijmo/flexgridxlsxconverter---gt#wijmoarchivehiin-the-fiddl

    This isn’t a react sample but should help you achieve what you need

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels