We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ExportDataTable delete column when not contains data

I have using XLSIO create report.
But when I used method ExportDataTable of Sheet Then
If column Have data -> ok
But If column does not data -> data does not contains column name

Help me


3 Replies

SR Sridhar Syncfusion Team August 17, 2011 04:59 AM UTC

HI Nguyen,

Thank you very much for using Syncfusion products.

We have tried the sample at our side to Export the sheet data to the data table and we could not reproduce the reported issue. We have attached the sample for your reference.

In the sample, the input file "NorthwindDataTemplate-Copy.xls" the column D "Contact Title" does not contain the data and when exporting to the data table , the data table contains the Column Name and "Null" values in that column values.

If i remove the Column Name and data values in the Column 'D' the data table contains the Default Column name "Column1" and null values for that column.

Please try the sample at your side and let us know if these helps you.

Please let us know if you require any further clarifications.


Regards,
Sridhar.S



ImportExportDataTable_4f3b6b9.zip


TO toumir replied to Nguyen Duy Hung March 16, 2018 07:03 PM UTC

I have using XLSIO create report.
But when I used method ExportDataTable of Sheet Then
If column Have data -> ok
But If column does not data -> data does not contains column name

Help me


Yes I agree


AV Abirami Varadharajan Syncfusion Team March 19, 2018 11:34 AM UTC

Hi Toumir, 

Thank you for contacting Syncfusion support. 

When particular column has only column name and doesn’t have any data, column name with null values gets added to the data table. Please refer to the below sample for the same. 


If your scenario differs, please get back to us with modified issue reproducing sample along with the details of your current working version of ‘Syncfusion.XlsIO.Base.dll’ assembly. 

Please refer to below documentation to know more about exporting data from worksheet to datatable. 


Regards, 
Abirami. 


Loader.
Live Chat Icon For mobile
Up arrow icon