Posted 16 June 2020, 1:49 am EST - Updated 3 October 2022, 1:19 am EST
Hi,
I am working with SpreadJS for the last few months. I got an issue with column width when importing an external xlsx file. Before importing the xlsx file I did some manual adjustment like expanded few columns and merged few cells. See the following image
And after importing it using “excelIO.open()” and loading it with the json data the expanded columns are not being shown. When I am uploading it to google drive or S3 server they are showing it with correct adjusted widths. But spreadJS is showing with default width of the columns and not showing the adjusted widths. Like the following image
Then I used the method “autoFitColumn(col)” for all the columns. Like following
var currentSheet;
var colCount;
var col;
var index;
for (index = 0; index < spread.getSheetCount(); index++) {
currentSheet = spread.getSheet(index);
colCount = currentSheet.getColumnCount();
for (col = 0; col < colCount; col++) {
currentSheet.autoFitColumn(col);
}
}
But it’s collapsing the first column of the columns merged like the following
Is there a way to achieve what I am trying here?
Note: I am using the version 10.2.3.
Ths sample xlsx file is in the zip.
Thanks in advance