The value of the cell C1 should not be a string value.
Aspose.cells打開文件之后輸出為DataTable,是將第一行作為數(shù)據(jù)類型判斷,列具有混合數(shù)據(jù)集
錯(cuò)誤代碼
var cells = workbook.Worksheets[0].Cells; var detailTable = cells.ExportDataTable(0, 0, cells.MaxRow + 1, cells.MaxColumn + 1, exportTableOptions);
正確代碼
var cells = workbook.Worksheets[0].Cells;
var exportTableOptions = new ExportTableOptions { CheckMixedValueType = false, ExportColumnName = true, ExportAsString = true };
var detailTable = cells.ExportDataTable(0, 0, cells.MaxRow + 1, cells.MaxColumn + 1, exportTableOptions);

浙公網(wǎng)安備 33010602011771號(hào)