汇总BUG修复

parent 4096ec25
...@@ -233,7 +233,7 @@ public string AllComputerDown(sys_hospital hospital, List<dynamic> dynamics, str ...@@ -233,7 +233,7 @@ public string AllComputerDown(sys_hospital hospital, List<dynamic> dynamics, str
if (col == 0) if (col == 0)
worksheet.SetValue(dynamics.Count() + 2, col + 1, "合计"); worksheet.SetValue(dynamics.Count() + 2, col + 1, "合计");
else if (!notSum.Contains(headList[col].Name.ToLower())) else if (!notSum.Contains(headList[col].Name.ToLower()))
worksheet.Cells[dynamics.Count() + 3, col + 1].Formula = string.Format("SUM({0})", new ExcelAddress(2, col + 1, dynamics.Count() + 1, col + 1).Address); worksheet.Cells[dynamics.Count() + 3, col + 1].Formula = string.Format("SUM({0})", new ExcelAddress(3, col + 1, dynamics.Count() + 2, col + 1).Address);
} }
#region 样式设置 #region 样式设置
...@@ -258,6 +258,10 @@ public string AllComputerDown(sys_hospital hospital, List<dynamic> dynamics, str ...@@ -258,6 +258,10 @@ public string AllComputerDown(sys_hospital hospital, List<dynamic> dynamics, str
worksheet.Cells[2, 1, 2, headList.Count].Style.Font.Bold = true; worksheet.Cells[2, 1, 2, headList.Count].Style.Font.Bold = true;
worksheet.View.FreezePanes(3, 1); worksheet.View.FreezePanes(3, 1);
worksheet.Cells.AutoFitColumns(); worksheet.Cells.AutoFitColumns();
for (int col = worksheet.Dimension.Start.Column; col <= worksheet.Dimension.End.Column; col++)
{
worksheet.Column(col).Width = worksheet.Column(col).Width > 20 ? 20 : worksheet.Column(col).Width;
}
#endregion #endregion
} }
package.Save(); package.Save();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment