Free Support Forum -

ExportDataTable Issue

We have had version in our company and it was working great. Just doing basic things like export an Excel File to a DataSet and Export a DataSet to an Excel file. I upgraded to the latest version 3.4.0 today and am having all sorts of Data Corruption.

This is the code I’m using:

DataTable table = sheet.Cells.ExportDataTable(0, 0, maxRow, maxColumn, true);
When I make this call now, I either have exceptions being thrown, or the data that comes in is corrupted. It’s different each time I run the same method with the same file as well. You can see below that the colum name didn’t come in correctly. Also, sometimes the data won’t come in either. The Excel file is big, but there was no issue with this file in Is there something that I’m missing?

Thanks in Advanced,

Example of Corrupted Column Name:

<xs:element name=“Loan_Information_Values”>
<xs:element name=“zWGX92” type=“xs:string” minOccurs=“0”/>
<xs:element name=“type” type=“xs:string” minOccurs=“0”/>
<xs:element name=“date” type=“xs:string” minOccurs=“0”/>
<xs:element name=“value” type=“xs:string” minOccurs=“0”/>

Example of Corrupted Data:

A-2 Note balance

I think you bought the license before 2005/01/22. Please check for reference.

Those random string is added in evaluation edition. We have changed our license schema since 2005/01/22. You should contact our sales team to upgrade your license file.


Just redirect customers to when they need new license file.

I deleted the license information for it's not appropriate to make it public.

How do you call the license code? Please check for reference.

Could you please post your template file here? It can only be accessed by you and Aspose developers.

Sure, here you go…

Oh, do I have to set it on the open? I was just setting it when I saved…

The following is my test code and all works fine:

Aspose.Excel.License license = new Aspose.Excel.License();

Excel excel = new Excel();

Excel excel2 = new Excel();

for(int i = 0; i < excel.Worksheets.Count; i ++)
DataTable dt = excel.WorksheetsIdea.Cells.ExportDataTableAsString(0, 0, excel.Worksheets[0].Cells.MaxRow, excel.Worksheets[0].Cells.MaxColumn, true);
excel2.WorksheetsIdea.Cells.ImportDataTable(dt, true, 0, 0);

Yes. Set license before opening the file and you just need to set once in your program. Generally please set it at the start of your program.

OK, once I set the license on the import, it worked great. Thank you for your help.