Hi Khanh Dang,
Greetings from Syncfusion.
You can achieve your requirement by slightly modifying your code with ‘|’ symbol to utilize multi export option as below.
Code snippet:
|
sheet.ExportDataTable(sheet.Range["A1:C4"], ExcelExportDataTableOptions.DetectColumnTypes | ExcelExportDataTableOptions.ColumnNames); |
Kindly let us know if it helps.
Regards,
Shamini