Sets or returns the layout option for the pivot table.

public PivotTableLayout.LayoutOptions ReportLayout { get; set; }
Public Property ReportLayout() As PivotTableLayout.LayoutOptions
          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Open(@"C:\MySpreadsheet.xlsx");
          Worksheet ws = wb.Worksheets[0];
          PivotTableLayout.LayoutOptions layout = ws.PivotTables[0].PivotTableLayout.ReportLayout;
          ws.PivotTables[0].PivotTableLayout.ReportLayout = PivotTableLayout.LayoutOptions.Tabular;
        
          Dim xla As New ExcelApplication()
          Dim wb As Workbook = xla.Open("C:\MySpreadsheet.xlsx")
          Dim ws As Worksheet = wb.Worksheets(0)
          Dim layout As PivotTableLayout.LayoutOptions = ws.PivotTables(0).PivotTableLayout.ReportLayout
          ws.PivotTables(0).PivotTableLayout.ReportLayout = PivotTableLayout.LayoutOptions.Tabular
        

This property corresponds to the PivotTable layout options under PivotTable Layout on the Design tab. Together with the PivotTableSettings.ClassicLayout property this enables the ability to drag and drop fields in the PivotTable grid.

The default layout value of is Compact for PivotTables generated by ExcelWriter.