@Nidhi.chawhan
Thanks for using Aspose APIs.
You can hide the pivot table by hiding the rows of the worksheet.
Please see the following sample code, its sample Excel file containing the pivot table and its output Excel file. If you open the output Excel file, you will see Pivot Table is hidden.
Download Links:
sample and output Excel files.zip (16.5 KB)
C#
//Load sample Excel file
Workbook wb = new Workbook("samplePivot.xlsx");
//Access first worksheet
Worksheet ws = wb.Worksheets[0];
//Access the pivot table
PivotTable pt = ws.PivotTables[0];
//Hide the pivot table
CellArea range = pt.TableRange2;
ws.Cells.HideRows(range.StartRow, range.EndRow - range.StartRow + 1);
//Save the output Excel file
wb.Save("outputPivot.xlsx");