We are evaluating Aspose Excel V1.8, we noticed then when we read a spreadsheet and export it to a datatable using ExportDataTableAsString, the cells that contain a formula (say cell has =1+2) are translated to Null, if we read the cell using the cell object however we get a IntValue as 3 which is correct and a stringvalue errors out.
Is it possible to get the computed value 3 when we use ExportDataTableAsString, so that we dont have to loop thru all the cells in order to read excel.
I will investigate this problem and fix it ASAP.
Thanks for your patience.
@msdate,
Aspose.Excel is discarded now and a new product Aspose.Cells is introduced which provides rich features available in the recent versions of MS Excel. You can export data from worksheet using this new product as follows:
string filePath = dataDir + "Book1.xlsx";
// Instantiating a Workbook object
Workbook workbook = new Workbook(filePath);
// Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.Worksheets[0];
// Exporting the contents of 7 rows and 2 columns starting from 1st cell to DataTable
DataTable dataTable = worksheet.Cells.ExportDataTableAsString(0, 0, 11, 2, true);
foreach (DataRow r in dataTable.Rows)
{
foreach (DataColumn c in dataTable.Columns)
{
string value = r.Field<string>(c);
Console.Write(value + " ");
}
Console.WriteLine();
}
More details about this feature are available here:
Export Data from Worksheet
Here is the link to the latest version of this product:
Aspose.Cells for .NET (Latest Version)
A detailed ready to run solution is available here for testing the features:(GitHub - aspose-cells/Aspose.Cells-for-.NET: Aspose.Cells for .NET examples, plugins and showcases).