Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# EPPlus中的单元样式PatternType_C#_Excel_Epplus - Fatal编程技术网

C# EPPlus中的单元样式PatternType

C# EPPlus中的单元样式PatternType,c#,excel,epplus,C#,Excel,Epplus,我一直在寻找一种方法,在使用EPPlus时将列中单元格的模式类型设置为对角交叉线 首先,在这里更改库不是一个选项,因为原始工作不是我的,我不想把它搞砸 那么,我们如何设置PatternType,比如说对角线交叉线或薄水平条,诚实地搜索整个互联网,却不知道如何做到这一点 我一直在使用的代码样本行: ws.Cells["D1:D" + lastRowNumber].Style.Fill.PatternType=OfficeOpenXml.Style.ExcelFillStyle.Gray125;

我一直在寻找一种方法,在使用EPPlus时将列中单元格的模式类型设置为对角交叉线

首先,在这里更改库不是一个选项,因为原始工作不是我的,我不想把它搞砸

那么,我们如何设置PatternType,比如说对角线交叉线或薄水平条,诚实地搜索整个互联网,却不知道如何做到这一点

我一直在使用的代码样本行

ws.Cells["D1:D" + lastRowNumber].Style.Fill.PatternType=OfficeOpenXml.Style.ExcelFillStyle.Gray125;

要更改图案类型,只需更改ExcelFillStyle即可

对于较薄的水平条纹:

ws.Cells["D1:D" + lastRowNumber].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.ThinHorizontal;
对于对角线交叉线:

ws.Cells["D1:D" + lastRowNumber].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.LightTrellis;

是的,在尝试不同的设置后,我也发现了这一点。可惜他们没有详细的文档,谢谢。