提交当前本机整理版本
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,4 +121,30 @@ namespace Lskj.AutoWordFile
|
||||
AutoCreatWord.CreateWordUtil.DbOperator = new Lskj.Data.ADO.Template.DbTemplate(string.Format("server={0};database={1};persist security info=true;user id=lserpAdmin;password=lserp110;max pool size = 512;", DBConfig.Instance.ServerName, DBConfig.Instance.DataBase), "system.data.sqlclient");
|
||||
string[] masterSqls = Model.MasterSql.Trim('^').Split('^');
|
||||
List<DataSet> dataSets = new List<DataSet>();
|
||||
for
|
||||
foreach (string masterSql in masterSqls)
|
||||
{
|
||||
if (string.IsNullOrEmpty(masterSql)) continue;
|
||||
dataSets.Add(SqlHelper.ExecuteDataSet(masterSql));
|
||||
}
|
||||
AutoCreatWord.CreateWordUtil.Create(mainTempPath, menuTempPath, Model.MenuTempArray, dataSets, savePdfPath, SystemInfo.Instance.OAUrl, out string msg);
|
||||
cts.Cancel();
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
progressBar1.Value = 100;
|
||||
Process.Start(savePdfPath);
|
||||
Close();
|
||||
}));
|
||||
}
|
||||
});
|
||||
crateTask.Start();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user