提交当前本机整理版本
This commit is contained in:
@@ -1810,4 +1810,33 @@ namespace Lskj.AutoCreatWord
|
||||
|
||||
// 创建新的 DataTable 用于存储分组结果
|
||||
DataTable groupedTable = selectTable.Clone();
|
||||
|
||||
foreach (var group in groupedData)
|
||||
{
|
||||
// 将动态键拆分成各个部分,并添加到新行
|
||||
object[] keyParts = Regex.Split(group.Key.Key, separator);
|
||||
DataRow newRow = groupedTable.NewRow();
|
||||
for (int i = 0; i < keyParts.Length; i++)
|
||||
{
|
||||
newRow[groupByColumns[i]] = keyParts[i];
|
||||
}
|
||||
groupedTable.Rows.Add(newRow);
|
||||
}
|
||||
dataTable = groupedTable;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///word表格数据配置的集合
|
||||
/// </summary>
|
||||
protected class GridTarGet
|
||||
{
|
||||
public string number;
|
||||
public Section targetSection;
|
||||
public Table targetTable;
|
||||
public int rowIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user