首页 > 解决方案 > SoftArtisans 'Border.Part.Outline' 作为 SoftArtisans 'Border.Part.All' 工作

问题描述

SoftArtisans 库 - Excel 97

SoftArtisans 'Border.Part.Outline' 作为 SoftArtisans 'Border.Part.All' 工作。

说明:Excel 2016 '/Home/Outside Borders' 选项相当于 SoftArtisans 'Border.Part.Outline' 问题很简单。这永远不会按预期工作。

如果我们得到一些单元格范围,例如从 1 到 10 -> rows[1:10] 而不合并这些范围单元格,则将边框“ Border.Part.Outline ”选项设置为“ Border.Part.All ”,这是错误的。

这里有一些伪代码:

var myRange = getMyCustRange(myRows[1:10]);
 Style mystyle  = Workbook.GlobalStyle.CreateStyle();

 // If I want to clear border
 mystyle.Border[Border.Part.All] =  Border.LineStyle.None; // test pass, worked!

 // If I want to set border to all cell part of the current range
 mystyle.Border[Border.Part.All] =  Border.LineStyle.Thin; // test pass, worked!

 // If I want to remove Outside Borders
 mystyle.Border[Border.Part.Outline] =  Border.LineStyle.None; // test pass, worked!

 // If I want to set only Outside Borders into current range with more than one rows and thoose rows are not merged -> Area.MergeCells();
 mystyle.Border[Border.Part.Outline] =  Border.LineStyle.Thin; // test FAILED!!!



// Part : TypesafeEnum       
        Border.Part All;
        Border.Part Bottom;
        Border.Part DiagonalBoth;
        Border.Part DiagonalDown;
        Border.Part DiagonalUp;
        Border.Part Left;
        Border.Part Outline;
        Border.Part Right;
        Border.Part Top;

标签: excel

解决方案


推荐阅读