We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Unable to open an external XLSX file with same code as demo but in nextjs

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


1 Reply 1 reply marked as answer

VR Vasanth Ravi Syncfusion Team March 21, 2023 05:50 AM UTC

Hi Majid,


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

 

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



On the open URL, 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 method, not on the open method. We have modified the sample and attached it below for your reference. 

 

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


Also attached are 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


Marked as answer
Loader.
Live Chat Icon For mobile
Up arrow icon