Free Support Forum - aspose.com

Export Excel to data table as string without the column name using Aspose.Cells for .NET in C#Export Excel to data table as string without the column name using Aspose.Cells for .NET in C#

Issue: ExportDataTableAsString doesn’t seem to handle properly the cases where exportColumnName is set to false.

Run the following code against the attached spreadsheet.

using System;
using System.Collections;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Aspose.Cells;
using Aspose.Cells.Charts;
using Aspose.Cells.Drawing;
using Aspose.Cells.Pivot;
using Aspose.Cells.Rendering;
using Aspose.Cells.Tables;
using TestAspose.NorthwindDataSetTableAdapters;
//using pk =DocumentFormat.OpenXml.Packaging;
//using ox=DocumentFormat.OpenXml;
//using oxs = DocumentFormat.OpenXml.Spreadsheet;


namespace TestAspose
{
class Program
{



static void Main(string[] args)
{
TestExportDataTableAsString();

Console.WriteLine(“Done!”);
Console.ReadKey();
}

public static void TestExportDataTableAsString()
{
Workbook workbook = new Workbook(@“C:\temp\spreadsheets\test_ExportDataTableAsString.xlsx”);
Worksheet worksheet = workbook.Worksheets[0];
Range displayRange = worksheet.Cells.MaxDisplayRange;

DataTable dataTable = worksheet.Cells.ExportDataTableAsString(0, 0,displayRange.RowCount, displayRange.ColumnCount, false);
dataTable.TableName = “Data”;
Console.WriteLine(“First DataTable”);
dataTable.WriteXml(Console.Out);
Console.WriteLine();
ExportTableOptions options = new ExportTableOptions();
options.ExportAsString = true;
options.ExportColumnName = false;
dataTable = worksheet.Cells.ExportDataTable(0, 0, displayRange.RowCount, displayRange.ColumnCount, options);
dataTable.TableName = “Data2”;
Console.WriteLine();
Console.WriteLine(“Second DataTable”);
dataTable.WriteXml(Console.Out);
Console.WriteLine();

}
}
}

This program produces the following output:

First DataTable







ss



Second DataTable


1
2
4







ss


Done!

As you can see, the first row is missing in the first DataTable. That should not happen.

I tested this with version 7.5.3.4.

Thanks

Hi Costa,

Thank you for sharing your findings.

I am able to reproduce the issue on my end while using the latest version of the product, therefore I have logged it in our bug tracking system under ticket Id CELLSNET-42041. We will soon investigate it in detail, and will try to provide the fix at earliest.

Hi,


Please try our latest version/fix: Aspose.Cells for .NET (Latest Version), we have fixed your issue now.

Let us know your feedback.

Thanks,

Just curious, when you post a new minor version of the dll, where can I see the changes that went into this release?

Thanks

Hi,


I think you have missed my previous post in this thread, I have already provided a minor version/fix (v7.5.3.5) that you may use which fixes your issue. Anyways, you may try downloading our latest version/fix: Aspose.Cells for .NET (Latest Version), in which we have fixed your issue.

If you are talking about our major release of the product, yes, our next official release v7.6.0 would include the functionality of all the previous fixes including v7.5.3.5. And, our next official release is due within the next couple of weeks.


Let us know if you still have any confusion or issue.

Thank you.

Sorry for the confusion, but I understood that you fixed the issue in this thread. What I was asking is what other changes went into 7.5.3.5 since 7.5.3.4 and whether it was possible to view the list of fixes?

Usually when a company releases a new version of a library they provide a list of changes since the previous release. Is there a list for 7.5.3.5?

Thank you

Hi,


Well, the release notes are only available and pasted when we publish our official release of the product in the Downloads module:
https://downloads.aspose.com/cells/net

Anyways, I will try to sum up what new and important enhancements or fixes are included in the new minor fix/version: v7.5.3.5:

i) A fix included in the version regarding Data Sorting
ii) A fix included in the version regarding rendering images for the worksheets (Out of memory exception issue is sorted out)
iii) A fix related to DATEDIF formula/function
iv) A fix added regarding Japanese fonts issue.
v) A fix regarding Pivottable issue.

Hope, the above helps you a bit for your requirements.

For complete list features, enhancements and fixes, you have to wait for our next official release of the product when we publish it.

Thank you.

Thanks, that was what I was looking for.

The issues you have found earlier (filed as CELLSNET-42041) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.