syncfusion/ej2-react-ui-components

spreadsheet wont open excel file in nextjs

trsiddiqui opened this issue · 2 comments

Neither it works with openUrl nor using the ref and then setting the file in created event. Here is the codesandbox.

https://codesandbox.io/s/next-js-forked-dgibx3?file=/index.html

Upon verifying your provided code-sandbox sample we noticed that you have provided the file load URL on the openURL.

openUrl="https://js.syncfusion.com/demos/ejservices/data/Spreadsheet/LargeData.xlsx"

On the openURL you must provide the server-side action URL not the file load URL. With the server-side action URL we make a call to the XLSIO engine and perform the import action.

You must provide the file load URL only on the fetch not on the open method. We have modified the sample and attached below for your reference.

Sample Link: https://codesandbox.io/s/next-js-forked-7i785l?file=/index.js

Also attached the API links for reference.

https://ej2.syncfusion.com/react/documentation/spreadsheet/open-save#open-an-external-url-excel-file-while-initial-load

https://ej2.syncfusion.com/react/documentation/api/spreadsheet/#open

https://ej2.syncfusion.com/react/documentation/api/spreadsheet/#openurl

This issue has been automatically closed due to no response from the original author.
Please feel free to reopen it if you have more information that can help us investigate the issue further.