Welcome to the React feedback portal. We’re happy you’re here! If you have feedback on how to improve the React, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
Hi Team,
I have used spreadsheet component from syncfusion in react and used a controller from where I am calling workbook open method to open the excel file but i am getting an intermittent issue where component opens up index.html page in the spreadsheet instead of opening original excel file. Can you please check this?
Controller code -
[HttpPost]
public IActionResult Open(IFormCollection openRequest)
{
OpenRequest open = new OpenRequest();
open.File = openRequest.Files[0];
var strContent = Workbook.Open(open);
return Content(strContent);
}
React Code -
<React.Fragment>
<div className='control-pane'>
<div className='control-section spreadsheet-control'>
<SpreadsheetComponent openUrl={window.location.origin + getSiteUrl('/api/ExcelViewer/Open')} beforeOpen={this.beforeOpen} allowOpen={true}
allowEditing={false} isProtected enableKeyboardShortcut={false}
ref={(ssObj) => { this.spreadsheet = ssObj }} created={this.onCreated.bind(this)} />
</div>
</div>
</React.Fragment>