In the spreadsheet that is created, the conditional formatting on the column is there, but only on the rows outside of the pivot table. See screen print below from created spreadsheet. How can I get the formatting on the pivot table itself?
KCKarthikeyan Chandrasekar Syncfusion Team November 13, 2018 07:47 AM
Thank you for contacting Syncfusion support.
As per Microsoft Excel behavior, when a pivot table is added in a range where already data exist then the conditional format address in that range will be split into range above and below pivot table. This is the reason for the conditional format address change in the worksheet. So, we suggest you to set the pivot table location below the pivot table data range. The following notification pop up will be displayed in Microsoft Excel when this scenario occurs.
If you click “Yes” then the data will be changed, otherwise the pivot table will not be inserted.
Please let us know if you have any other queries.
SGSteve GoodNovember 13, 2018 11:07 AM
Thank you for the suggestion. I put the pivot table in a new tab, starting in cell A1 and now the formatting is below the pivot table. Is there a way to get the formatting on the pivot table? I can do it in Excel after the spreadsheet is created. Is there a way to do that in code?
KCKarthikeyan Chandrasekar Syncfusion Team November 14, 2018 07:17 AM
We suspect that the conditional formatting is not applied because of Microsoft Excel refresh the layout of the pivot table while opening the output document. So, we suggest you to use IPivotTable.Layout() method before saving the workbook.
We have shared a simple sample to achieve your requirement which can be downloaded from the following location.
I did try to put that line back in after the myPivotTable.Layout() call, but it still showed them grouped.
KCKarthikeyan Chandrasekar Syncfusion Team November 15, 2018 06:52 AM
We are not able to reproduce the issue from our end. So, we request you modify the sample provided in our previous update and share us along with issue reproducing input files. It will be helpful for us to analyze further on this and provide you the solution at earliest.