标签:last cell bsp str 总数 edr count region ring
获取sheet中存在合并单元格总数,循环绑定值
// 得到一个sheet中有多少个合并单元格 int sheetMergeCount = sheet.NumMergedRegions; for (var i = 0; i < sheetMergeCount; i++) { // 获取合并后的单元格 var range = sheet.GetMergedRegion(i); sheet.IsMergedRegion(range); var cellValue = sheet.GetRow(range.FirstRow).GetValue(range.FirstColumn).FormatUtf8String(); for (var mRowIndex = range.FirstRow; mRowIndex <= range.LastRow; mRowIndex++) { for (var mColumnIndex = range.FirstColumn; mColumnIndex <= range.LastColumn; mColumnIndex++) { table.Rows[mRowIndex][mColumnIndex] = cellValue; } } }
标签:last cell bsp str 总数 edr count region ring
原文地址:https://www.cnblogs.com/Cailf/p/9988525.html