更新进展:
经调研此问题属于V11的bug,在V15进行了修复。在您提供的json中,用法类似下方代码:
- var sheet = spread.getActiveSheet();
- sheet.getCell(1, 1).borderLeft(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick));
- sheet.getCell(1, 1).borderTop(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick));
- sheet.getCell(1, 1).borderRight(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick));
- sheet.getCell(1, 1).borderBottom(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick));
- sheet.getCell(2, 1).borderLeft(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick));
- sheet.getCell(2, 1).borderTop(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick));
- sheet.getCell(2, 1).borderRight(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick));
- sheet.getCell(2, 1).borderBottom(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick));
- sheet.getCell(3, 1).borderLeft(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick));
- sheet.getCell(3, 1).borderTop(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick));
- sheet.getCell(3, 1).borderRight(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick));
- sheet.getCell(3, 1).borderBottom(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick));
- sheet.addSpan(1, 1, 3, 1);
- sheet.getCell(4, 1).borderLeft(null);
- sheet.getCell(4, 1).borderTop(null);
- sheet.getCell(4, 1).borderRight(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick));
- sheet.getCell(4, 1).borderBottom(null);
- sheet.setRowVisible(3, false);
复制代码 如代码所示,合并的span有一个隐藏行(即第 4 行是隐藏的)。
SpreadJS 现在采用与 excel 相同的策略。
您可以分别使用v11和v15导入该json并保存为excel文件,您会发现导出的excel和v15一样,和v11不一样。
|