我如何在 C# 中更改数据透视列的设置
How can i change setting of Pivot column in C#
如何使用 Aspose.Cells
库在 C# 中更改此设置?请帮助....
screen
这是我的支点:
Aspose.Cells.Worksheet sheet2 = XLS.Worksheets.Add("pivotcha");
Aspose.Cells.Pivot.PivotTableCollection pivotTables = sheet2.PivotTables;
int index = pivotTables.Add("=Data!A1:" + "" + array_columns[dtb.Columns.Count-1].ToString() + "" + (dtb.Rows.Count+1).ToString() + "", "B3", "pivotcha");
Aspose.Cells.Pivot.PivotTable pivotTable = pivotTables[index];
pivotTable.RowGrand = true;
pivotTable.ColumnGrand = true;
pivotTable.AutoFormatType = Aspose.Cells.Pivot.PivotTableAutoFormatType.Report1;
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Column, 3);
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Column, 4);
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Column, 5);
答案是:
PivotTable.RowFields[index].ShowCompact = true;
如何使用 Aspose.Cells
库在 C# 中更改此设置?请帮助....
screen
这是我的支点:
Aspose.Cells.Worksheet sheet2 = XLS.Worksheets.Add("pivotcha");
Aspose.Cells.Pivot.PivotTableCollection pivotTables = sheet2.PivotTables;
int index = pivotTables.Add("=Data!A1:" + "" + array_columns[dtb.Columns.Count-1].ToString() + "" + (dtb.Rows.Count+1).ToString() + "", "B3", "pivotcha");
Aspose.Cells.Pivot.PivotTable pivotTable = pivotTables[index];
pivotTable.RowGrand = true;
pivotTable.ColumnGrand = true;
pivotTable.AutoFormatType = Aspose.Cells.Pivot.PivotTableAutoFormatType.Report1;
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Column, 3);
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Column, 4);
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Column, 5);
答案是: PivotTable.RowFields[index].ShowCompact = true;