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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ExportDataTable delete column when not contains data

Thread ID:

Created:

Updated:

Platform:

Replies:

100565 Aug 17,2011 04:00 AM UTC Mar 19,2018 11:34 AM UTC Windows Forms 3
loading
Tags: XlsIO
Nguyen Duy Hung
Asked On August 17, 2011 04:00 AM 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


Sridhar [Syncfusion]
Replied On 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

toumir
Replied On 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

Abirami Varadharajan [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;