Aspose.cells 23.9添加颜色筛选结果不正确

使用以下代码进行测试:

using Aspose.Cells;

var wb = new Workbook("input.xlsx");
var worksheet = wb.Worksheets[0];

var style = worksheet.Cells["A14"].GetDisplayStyle();
var cellColor = wb.CreateCellsColor();
cellColor.Color = style.Font.Color;

// filter Sheet1.A14 Cell font color fail
var filter = worksheet.AutoFilter;
filter.AddFontColorFilter(0, cellColor);
filter.Refresh(true);
Console.WriteLine("Sheet1 row 14 hidden: " + worksheet.Cells.Rows[13].IsHidden);

// can't get correct filter color
Console.WriteLine("Expect color:" + cellColor.Color);
Console.WriteLine("Actual color:" + (filter.FilterColumns[0].Filter as ColorFilter).GetColor(wb.Worksheets));

// filter Sheet1.A14 Cell fill color fail
var foregroundColor = wb.CreateCellsColor();
var backgroundColor = wb.CreateCellsColor();
foregroundColor.Color = style.ForegroundColor;
backgroundColor.Color = style.BackgroundColor;
filter.AddFillColorFilter(0, style.Pattern, foregroundColor, backgroundColor);
filter.Refresh(true);
Console.WriteLine("Sheet1 row 14 hidden: " + worksheet.Cells.Rows[13].IsHidden);

worksheet = wb.Worksheets[1];
filter = worksheet.AutoFilter;

// filter Sheet2.B3 Cell fill color success
style = worksheet.Cells["B3"].GetDisplayStyle();
foregroundColor.Color = style.ForegroundColor;
backgroundColor.Color = style.BackgroundColor;
filter.AddFillColorFilter(1, style.Pattern, foregroundColor, backgroundColor);
filter.Refresh(true);
Console.WriteLine("Sheet2 row 3 hidden: " + worksheet.Cells.Rows[2].IsHidden);

// filter Sheet2.A4 Cell fill color fail
style = worksheet.Cells["A4"].GetDisplayStyle();
foregroundColor.Color = style.ForegroundColor;
backgroundColor.Color = style.BackgroundColor;
filter.AddFillColorFilter(0, style.Pattern, foregroundColor, backgroundColor);
filter.Refresh(true);
Console.WriteLine("Sheet2 row 4 hidden: " + worksheet.Cells.Rows[3].IsHidden);

样例文件:
input.zip (8.3 KB)
出现的问题:

  1. 条件格式的背景颜色与字体颜色不能正常筛选(行14,27)
  2. ColorFilter.GetColor 函数返回的颜色不是筛选的值(行17)
  3. 直接设置的单元格颜色筛选有时可以,有时不可以(行38,46)

@CatPP,

我们在初步测试后发现了这个问题。 我们需要详细评估您的问题。 我们已在内部问题跟踪系统中打开以下新票证,并将根据免费支持政策中提到的条款提供修复。
问题 ID:CELLSNET-54305

@CatPP,

我们很高兴地通知您,您之前记录为“CELLSNET-54305”的问题已得到解决。 该修复将包含在我们计划于 11 月上半月发布的即将发布的版本 (Aspose.Cells v23.11) 中。 新版本发布时您将收到通知。

The issues you have found earlier (filed as CELLSNET-54305) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi