While excel sheet import Header are getting replaced with DEFAULT A/B/C

Posted by: tarun.softengg on 7 July 2021, 11:13 am EST

    • Post Options:
    • Link

    Posted 7 July 2021, 11:13 am EST

    I created a worksheet with custom headers names now I have exported this sheet but when I import this sheet then it’s not replacing default headers on a new worksheet

    I want to keep headers the same as the exported sheet

    Please check if I am missing some import setting “spread.fromJSON(data);”

    		activeSheet.setText(0, column, name, spreadNS.SheetArea.colHeader);
    		activeSheet.setText(1, column, name, spreadNS.SheetArea.colHeader);
    		activeSheet.setText(0, column, name, spreadNS.SheetArea.colHeader);
    
    
    	function fileChange(e) {
    		if (_spread) {
    			const fileDom = e.target || e.srcElement;
    			const excelIO = new Excel.IO();
    			const spread = _spread;
    			// we want dynamic column headers
    
    			excelIO.open(fileDom.files[0], (data) => {
    				console.log(data);
    				spread.fromJSON(data);
    			});
    			spread.options.highlightInvalidData = true;
    		}
    	}
    
  • Posted 8 July 2021, 5:38 am EST

    Hi Tarun,

    From the code snippet, it looks like you are exporting the sheet as Excel. Actually, Excel does not support the custom header it is the SpreadJS feature. that is why it is not getting exported in an excel file. for exporting the custom header you need to export the sheet as JSON.

    hope this clarifies the issue. Feel free to revert back if have any queries regarding this case.

    Regards,

    Avinash

Need extra support?

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

Learn More

Forum Channels