I have checked this scenario and found that you are incorrectly setting the Pivot Table’s data source. Please note, in Output.xlsx, the data source is set to Inv02311698_Recap!$A$1:$Y$10871 where there are only 1088 data rows in the worksheet Inv02311698_Recap. If you include those empty rows in the Pivot Table’s data source, they will surely show in the Pivot Table as well.
Please use the following statement to add the Pivot Table in your code. Please also check the resultant spreadsheet for worksheet Summary 2.
C#
int index = pivotTables.Add("=" + workbook.Worksheets[“Inv02311698_Recap”].Name + “!A1:Y” + (workbook.Worksheets[“Inv02311698_Recap”].Cells.MaxDataRow + 1), “B3”, “PivotTable1”);