本帖最后由 Ellia.Duan 于 2024-2-1 11:20 编辑
产品:GcExcel .net
版本:V6.2.5
调研编号:DOCXLS-9725
LastReview:2024-2-1
计划在v7.0.3版本修复。
复制合并单元格样式复制不正确
最后输出结果:
期望可以复制合并单元格样式,期望的最终结果如附件视频所示;
样例sjs见附件
使用代码如下:
- const string path = @"D:\Download\a.sjs";
- // output pid
- Process currentProcess = Process.GetCurrentProcess();
- Console.WriteLine($"pid: {currentProcess.Id}");
- Workbook workbook = new Workbook();
- workbook.Open(path, OpenFileFormat.Sjs);
- IRange source = workbook.Worksheets[0].Range["B2:M2"];
- IRange target = workbook.Worksheets[0].Range["B10:M10"];
-
- // copy style
- source.Copy(target, new PasteOption
- {
- PasteType = PasteType.Formats | PasteType.ColumnWidths | PasteType.RowHeights
- });
-
- // save to target.sjs
- workbook.Save(@"D:\Download\target.sjs", SaveFileFormat.Sjs);
-
- string json = workbook.ToJson();
- // save to target.json
- File.WriteAllText(@"D:\Download\target.json", json);
- Assert.Pass();
复制代码
|
|