Hello,
Thanks for your inquiry. After an initial test with the latest Spire.Office hotfix(
Spire.Office Platinum (Hot Fix) Version:2.15.5) along with the following codes, I have not managed to reproduce the issue you mentioned on my end, so please attach the codes you were trying for investigation further.
- Code: Select all
Workbook book = new Workbook();
book.Worksheets.Clear();
//add data
Worksheet dataSheet = book.Worksheets.Add("Data");
dataSheet.Range["A1"].Value = "Product";
dataSheet.Range["A2"].Value = "Spire";
dataSheet.Range["B1"].Value = "Month";
dataSheet.Range["B2"].Value = "January";
dataSheet.Range["C1"].Value = "Count";
dataSheet.Range["C2"].Value2 = 10;
//create pt
Worksheet ptSheet = book.Worksheets.Add("Pt");
PivotCache pc = book.PivotCaches.Add(dataSheet["A1:C3"]);
PivotTable pt = ptSheet.PivotTables.Add("PivotTable", ptSheet.Range["B2"], pc);
PivotField field1= pt.PivotFields["Product"] as PivotField;
field1.Axis = AxisTypes.Row;
PivotField field2 = pt.PivotFields["Month"] as PivotField;
field2.Axis = AxisTypes.Row;
IPivotField fieldItemsTotal = pt.PivotFields["Count"];
pt.DataFields.Add(fieldItemsTotal, "Sum Of Count", SubtotalTypes.Sum);
pt.BuiltInStyle = PivotBuiltInStyles.PivotStyleDark14;
//Enable Show Details in the pivot table options data
pt.EnableDrilldown = true;
book.SaveToFile("CreatePT.xlsx",ExcelVersion.Version2010);
Secondly, the EnableDrilldown property for PivotTable represents the setting to Enable Show Details in the pivot table options data.
Sincerely,
Gary
E-iceblue support team