[Sv] - Can i combine multi export option?

Hi,
I tried exporting data contains datetime format to datatable,I need to combine 2 conditions with or without header and require detectdatatype.
Can i do this?
sheet.ExportDataTable (sheet.Range ["A1: C4"], ExcelExportDataTableOptions.DetectColumnTypes &&ExcelExportDataTableOptions.columnname);
Thanks you!

5 Replies

SK Shamini Kiruba Sobers Syncfusion Team May 18, 2020 12:33 PM UTC

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 



TG The GridLock May 18, 2020 02:32 PM UTC

Thanks Shamini,
This will help me soon.


SK Shamini Kiruba Sobers Syncfusion Team May 19, 2020 06:27 AM UTC

Hi Khanh Dang, 

We are glad that you are happy with the solution. 

Regards, 
Shamini 



CH Christoph January 2, 2024 02:48 PM UTC

Hi,

but what about NO ColumnNames?

I what the first row as data row and not for column names.

I can use  ExcelExportDataTableOptions.ColumnNames but what is the opposite?

Regards

Christoph



KM Kurmitha Manickhaperumal Syncfusion Team January 4, 2024 12:41 PM UTC

Hi Christoph, 


Greetings from Syncfusion. 


You can achieve your requirement by slightly modifying your code as below. 


Code snippet:


sheet.ExportDataTable(sheet.Range["A1:C4"], ExcelExportDataTableOptions.DetectColumnTypes); 


Kindly let us know if it helps. 


Regards, 

Kurmitha M.


Loader.
Up arrow icon