我正在尝试生成一个像普通Excel文件一样具有背景的excel文件。当我在我的程序中创建我的背景时,它将背景设置为黑色,而你看不到任何东西。我不确定我是否设置了错误的属性,但以下是我正在尝试的:
sheet.Cells.Style.Fill.PatternType = ExcelFillStyle.Solid;
//sheet.Cells.Style.Fill.BackgroundColor.SetColor( Color.Empty );
sheet.Cells.Style.Fill.PatternColor.SetColor( Color.Transparent );我要做的就是创建一个没有背景的excel文件,就像你手动创建一个空白的excel文件一样。有什么想法吗?

发布于 2018-04-17 15:18:58
你唯一要做的就是:
ws.Cells[range].Style.Fill.PatternType = ExcelFillStyle.None;
//ws.Cells[range].Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.Transparent);在您自己的代码中:
sheet.Cells.Style.Fill.PatternType = ExcelFillStyle.None;
//sheet.Cells.Style.Fill.BackgroundColor.SetColor( Color.Empty );
//sheet.Cells.Style.Fill.PatternColor.SetColor( Color.Transparent );就这样
https://stackoverflow.com/questions/39213499
复制相似问题