首页 > 其他分享 >The value of the cell C1 should not be a string value.

The value of the cell C1 should not be a string value.

时间:2023-03-22 11:13:50浏览次数:54  
标签:detailTable cells value should cell var C1 exportTableOptions

Aspose.cells打开文件之后输出为DataTable,是将第一行作为数据类型判断,列具有混合数据集

错误代码

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);

  

 

标签:detailTable,cells,value,should,cell,var,C1,exportTableOptions
From: https://www.cnblogs.com/yongxinwang/p/17242953.html

相关文章