Hi,
Hi Tamas,
Thanks for your posting and using Aspose.Cells.
Which version of Aspose.Cells you are using? Please let us know. We tested pivottable.FormatAll() in the latest version: Aspose.Cells for .NET (Latest Version) and it did not work well.
In the similar way, pivottable.Format(row, column, style) does not work well either.
Once, you tell us your version, we will test it against it and log this issue in our database for investigation and fix.
Hi Shakeel,

Hi Tamas,
Thanks for your posting and using Aspose.Cells.
It seems, there is some issue with the PivotTable.Format and FormatAll methods and I have logged my findings in our database so that this issue could be investigated and fixed accordingly.
When, some style is applied via PivotTable.Format or FormatAll method and output file is opened in MS-Excel 2010, it appears fine for a blink of eye and then area is whitened again.
So, this issue should be fixed. We will let you know once, we sort out this issue. This issue has been logged as CELLSNET-42532.
Hi,

Hi Tamás,
//Dragging Fields to Report Filter Area
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Page, “Type”);
Hi,

Hi Tamas,
Hi Tamas,
string filePath = myDir + “pastry2.xlsx”;
//Load workbook
Workbook workbook = new Workbook(filePath);
//Get worksheet containing the PivotTable using worksheet name
Worksheet worksheet = workbook.Worksheets[“PivotTable”];
//Get PivotTable instance
PivotTable table = worksheet.PivotTables[0];
//Create an instance of Style and add it to workbook style collection
Style style = workbook.CreateStyle();
//Set the style background color to yellow
style.BackgroundColor = Color.Yellow;
//Set the style pattern
style.Pattern = BackgroundType.Solid;
//Get the PivotTable range containing all cells of PivotTable
CellArea area = table.TableRange1;
//Iterate over the rows in the PivotTable range
for (int row = area.StartRow; row <= area.EndRow;row++ )
{
//Check which rows to paint
//In this case, 1st, 2nd and last
if (row == area.StartRow || row == area.StartRow + 1 || row == area.EndRow)
{
//Initialize an int variable to keep track of columns
int col = 0;
//Iterate till last column
while (col <= area.EndColumn)
{
//Set the format of each cell while accessing it through row and col indexes
//and apply the previously configured Style object
table.Format(row, col, style);
col++;
}
}
}
workbook.Save(myDir + “output.xlsx”);
Hi,
Hi Tamas,
Hi,
Hi Tamas,
Hi Babar,

Hi Tamas,