数据透视表报告布局以表格forms显示

什么是以表格forms显示Excel数据透视表布局的C#代码?

这里是我需要转换为C#的macros的代码:

ActiveSheet.PivotTables("PivotTable1").RowAxisLayout xlTabularRow 

这里是我的开始代码,显示我设置了什么variables:

 //Excel.Application excel = new Excel.Application(); activeWorkBook = excel.ActiveWorkbook; sheets = excel.Sheets; pivotWorkSheet = (Excel.Worksheet)sheets.Add(); // Create the Pivot Table pivotCaches = activeWorkBook.PivotCaches(); pivotCache = pivotCaches.Create(Excel.XlPivotTableSourceType.xlDatabase,"Sheet1!$A$2:$J$35"); pivotTable = pivotCache.CreatePivotTable("Sheet2!R2C1"); // Set the Pivot Fields pivotFields = (Excel.PivotFields)pivotTable.PivotFields(); 

我想通了,以防其他人正在寻找这个我用:

  pivotTable.RowAxisLayout(Excel.XlLayoutRowType.xlTabularRow);