Based on the example [Pivot Tables](https://closedxml.codeplex.com/wikipage?title=Pivot%20Table%20example) , do the following steps to reproduce the problem
Excellent example . It works perfect, but if you add more than one value will have a problem . Here I leave an example to reproduce the problem . Suppose Pastry class has one more property called "Amount" int
Step 1. Add two values
```
// The values in our table will come from the " NumberOfOrders " field
// The default setting is a full calculation of each row / column
pt.Values.Add ("NumberOfOrders");
// Another value ( THIS IS THE ONE THAT CAUSE THE PROBLEM )
pt.Values.Add ("Amount" ) ;
```
Step 2. Save the excel file
Step 3. Open the excel file , and throw the following message
We found a problem with Content ' Patry.xlsx ' . Do you want to try to recover as much content as possible ? If trusts origin of this book , please click yes .
Click yes, and I'll get the following message :
Removed Feature: PivotTable report from / xl / PivotTables / pivotTable.xml part ( PivotTable view)
Records removed : book Properties / xl / workbook.xml part ( Book)
Step 4. Final result , the pivot table is not generated
aTTACH project C# for reproduce problem.
Please expect your help to solve this problem .. thank you very much
Comments: I have started to do research into this issue, but I am not 100% sure the best way to fix this. The problem is because in Excel as soon as you add more then 1 field to values, Excel generates an automatic "Values Label" We need to generate this field, and update the Pivot Cache. The reason, I am hesitant to do anything at the moment, is because That Field can be moved between the Rows and Columns Categories. I am not super familiar with Excel Pivot Tables, and do not know how this would affect the API. Hopefully my research will help another developer who is more familiar with this part. It should be noted that the values field has a field index value < 0 in my case I observed it was -2. This is how you can tell the values field apart from an regular Pivot Field. See attached screenshot.
Excellent example . It works perfect, but if you add more than one value will have a problem . Here I leave an example to reproduce the problem . Suppose Pastry class has one more property called "Amount" int
Step 1. Add two values
```
// The values in our table will come from the " NumberOfOrders " field
// The default setting is a full calculation of each row / column
pt.Values.Add ("NumberOfOrders");
// Another value ( THIS IS THE ONE THAT CAUSE THE PROBLEM )
pt.Values.Add ("Amount" ) ;
```
Step 2. Save the excel file
Step 3. Open the excel file , and throw the following message
We found a problem with Content ' Patry.xlsx ' . Do you want to try to recover as much content as possible ? If trusts origin of this book , please click yes .
Click yes, and I'll get the following message :
Removed Feature: PivotTable report from / xl / PivotTables / pivotTable.xml part ( PivotTable view)
Records removed : book Properties / xl / workbook.xml part ( Book)
Step 4. Final result , the pivot table is not generated
aTTACH project C# for reproduce problem.
Please expect your help to solve this problem .. thank you very much
Comments: I have started to do research into this issue, but I am not 100% sure the best way to fix this. The problem is because in Excel as soon as you add more then 1 field to values, Excel generates an automatic "Values Label" We need to generate this field, and update the Pivot Cache. The reason, I am hesitant to do anything at the moment, is because That Field can be moved between the Rows and Columns Categories. I am not super familiar with Excel Pivot Tables, and do not know how this would affect the API. Hopefully my research will help another developer who is more familiar with this part. It should be noted that the values field has a field index value < 0 in my case I observed it was -2. This is how you can tell the values field apart from an regular Pivot Field. See attached screenshot.