@softwarelicense_aixgroup_com,
Please try our latest version/fix: Aspose.Cells for .NET v21.6.3 (attached)
Aspose.Cells21.6.3 For .Net2_AuthenticodeSigned.Zip (5.5 MB)
Aspose.Cells21.6.3 For .Net4.0.Zip (5.5 MB)
Aspose.Cells21.6.3 For .NetStandard20.Zip (5.5 MB)
There are some tips for you:
1.Adds PivotFormatCondition.AddDataAreaCondition(string fieldName) method which adds PivotTable conditional format limit in the data fields.
2.Adds PivotFormatCondition.AddDataAreaCondition(PivotField dataField) method which adds PivotTable conditional format limit in the data fields.
3.Adds PivotFormatCondition.AddRowAreaCondition(string fieldName) method which adds PivotTable conditional format range limit in the row fields.
4.Adds PivotFormatCondition.AddRowAreaCondition(PivotField rowField) method which adds PivotTable conditional format range limit in the row fields.
5.Adds PivotFormatCondition.AddColumnAreaCondition(string fieldName) method which adds PivotTable conditional format range limit in the column fields.
6.Adds PivotFormatCondition.AddColumnAreaCondition(PivotField columnField) method which adds PivotTable conditional format range limit in the column fields.
7.Adds PivotFormatCondition.SetConditionalAreas()method which sets conditional areas of PivotFormatCondition object.
The sample code in .NET as follows:
Workbook wb = new Workbook(filePath + “ConditionalFormattingSample.xlsx”);
PivotTable pivot = wb.Worksheets[0].PivotTables[0];
PivotFormatConditionCollection pfcs = pivot.PivotFormatConditions;
//clear all the current conditional formats.
pfcs.Clear();
wb.Worksheets[0].ConditionalFormattings.Clear();
int pIndex = pfcs.Add();
PivotFormatCondition pfc = pfcs[pIndex];
pfc.ScopeType = PivotConditionFormatScopeType.Field;
//Sample code 1:
pfc.AddDataAreaCondition(“LossRatio”);
pfc.AddRowAreaCondition(“CommonName”);
//Sample code 2:
// pfc.AddDataAreaCondition(pivot.DataFields[2]);
// pfc.AddRowAreaCondition(pivot.RowFields[0]);
pfc.SetConditionalAreas();
FormatConditionCollection fcc = pfc.FormatConditions;
int idx = fcc.AddCondition(FormatConditionType.CellValue);
FormatCondition fc = fcc[idx];
fc.Formula1 = “0.4”;
fc.Operator = OperatorType.GreaterOrEqual;
fc.Style.BackgroundColor = Color.Red;
wb.Save(filePath + “out.xlsx”);
wb.Save(filePath + “out.pdf”);
Your issue should be fixed in it.
Let us know your feedback.