Hi Ashokraj,
Thank you for your update.
If you want to export the PivotGrid without hidden rows, you need
to export the TableModel of the
PivotGrid. Because it will export the current structure of the Pivotgrid.
Please refer the below code:
private void
buttonAdv2_Click(object sender, EventArgs e)
{
SaveFileDialog savedialog = new
SaveFileDialog();
savedialog.AddExtension = true;
savedialog.FileName = "Sample";
savedialog.DefaultExt = "xlsx";
savedialog.Filter = "Excel file (.xlsx)|*.xlsx";
ExcelEngine excelEngine = new
ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2010;
IWorkbook chartBook = ExcelUtils.CreateWorkbook(1);
chartBook.Version = ExcelVersion.Excel2010;
IWorksheet sheet = chartBook.Worksheets[0];
Syncfusion.GridExcelConverter.GridExcelConverterControl grid = new Syncfusion.GridExcelConverter.GridExcelConverterControl();
grid.QueryImportExportCellInfo += new Syncfusion.GridExcelConverter.GridImportExportCellInfoEventHandler(grid_QueryImportExportCellInfo);
grid.GridToExcel(this.pivotGridControl1.TableModel, sheet,
Syncfusion.GridExcelConverter.ConverterOptions.Default);
chartBook.SaveAs("sample.xlsx");
Process.Start("sample.xlsx");
}
Note:
In the sample you can also export pivot
grid without SubTotal row. Please refer
the attached sample.
Please let me know if you have further
concerns.
Regards,
Neelakandan
Attachment:
Pivot_Exporting_Without_subtotal_and_Row_f9ff8d63.zip