Hi Support,
I am trying to read a excel with extension .xlsx but I get invalid content in .net core console 2.0 project So Could you explain me which code Does I need to add in order to read the extension .xlsx, please? when you have time,please.
the current code that I am using is the following:
TxtLoadOptions opts = new TxtLoadOptions(LoadFormat.Auto);
using (Workbook wb = new Workbook(@"D:\Database Import\Book_test_1.xlsx", opts))
{
Worksheet ws = wb.Worksheets[wb.Worksheets.ActiveSheetIndex];
Row row = ws.Cells.GetRow(0);
for (int colIndex = 0; colIndex <= ws.Cells.MaxDataColumn; colIndex++)
{
Console.WriteLine(row.GetCellOrNull(colIndex).StringValue);
}
for (int indexRow = 1; indexRow <= ws.Cells.MaxDataRow; indexRow++)
{
row = ws.Cells.GetRow(indexRow);
for (int colIndex = 0; colIndex <= ws.Cells.MaxDataColumn; colIndex++)
{
Console.Write(row.GetCellOrNull(colIndex).Value);
Console.Write(',');
}
Console.WriteLine();
}
}
When I ran this code in dot net core console. 2.0 the output is the following:
image.png (16.5 KB)
the .xlsx file that I am using is the following:
Book_test_1.zip (8.0 KB)
image.png (5.9 KB)
image.png (4.0 KB)
thanks,
Luis F. Camacho