Articles in this section
Category / Section

How to resolve the excel file corrupted while exporting from WinForms GridGroupingControl?

1 min read

Resolve the corrupted file while exporting from GridGroupingControl

The Excel file extension will be differed depending upon the excel versions. If the selected extension is not matched with excel version at the time of exporting the Grid to excel, it will throw the following message box in Excel,

Indicate the corrupted file export from GridGroupingControl

Solution

To resolve an incorrect excel version, ExcelVersion property can be used based on the excel version. This property can be seen under the GridGroupingExcelConverterControl class file.

C#

GridGroupingExcelConverterControl excelConverter = new GridGroupingExcelConverterControl(); 
// If .xls extension then make use of this code 
excelConverter.ExcelVersion = ExcelVersion.Excel97to2003; 
excelConverter.ExportToExcel(this.gridGroupingControl1, saveFileDialog.FileName, exportingOptions); 

 

VB

Dim excelConverter As GridGroupingExcelConverterControl = new GridGroupingExcelConverterControl()
' If .xls extension then make use of this code 
excelConverter.ExcelVersion = ExcelVersion.Excel97to2003
excelConverter.ExportToExcel(Me.gridGroupingControl1, saveFileDialog.FileName, exportingOptions)

Samples:

C#: Excel Exporting CS

VB: Excel Exporting VB

Reference link: https://help.syncfusion.com/windowsforms/gridgrouping/exporting

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied