fix: 报表导出没有分组时存在空行的情况
This commit is contained in:
parent
1a0b1ad3cc
commit
907e89f973
@ -328,15 +328,18 @@ public class SysReportConfigService : IDynamicApiController, ITransient
|
||||
|
||||
int currentRow = 1;
|
||||
int startCol = 1;
|
||||
foreach (var group in orderedGroups)
|
||||
if (orderedGroups.Any(u => u.Any(p => !string.IsNullOrEmpty(p.GroupTitle))))
|
||||
{
|
||||
int colCount = group.Count();
|
||||
worksheet.Cells[currentRow, startCol, currentRow, startCol + colCount - 1].Merge = true;
|
||||
worksheet.Cells[currentRow, startCol].Value = group.First().GroupTitle;
|
||||
startCol += colCount;
|
||||
}
|
||||
foreach (var group in orderedGroups)
|
||||
{
|
||||
int colCount = group.Count();
|
||||
worksheet.Cells[currentRow, startCol, currentRow, startCol + colCount - 1].Merge = true;
|
||||
worksheet.Cells[currentRow, startCol].Value = group.First().GroupTitle;
|
||||
startCol += colCount;
|
||||
}
|
||||
|
||||
currentRow++;
|
||||
currentRow++;
|
||||
}
|
||||
|
||||
// 处理列标题(使用Title或FieldName)
|
||||
var curColIndex = 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user