SVN r1219

SVN-Revision: r1219
This commit is contained in:
cyf
2026-06-22 02:25:39 +00:00
parent 72420dd59e
commit 1e2c081b6a
5 changed files with 164 additions and 87 deletions
+7 -2
View File
@@ -4256,8 +4256,9 @@ namespace Lskj.Control.Model
// 优先复制整个工作表,最大程度保留字体、边框、筛选、列宽等导出格式。
targetPackage.Workbook.Worksheets.Add(sheetName, sourceSheet);
}
catch
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
// 整表复制失败时,退回到逐格复制,仍然尽量保留单元格样式。
if (targetPackage.Workbook.Worksheets[sheetName] != null)
{
@@ -4399,7 +4400,11 @@ namespace Lskj.Control.Model
if (sourceSheet.View != null)
{
targetSheet.View.ShowGridLines = sourceSheet.View.ShowGridLines;
targetSheet.View.ZoomScale = sourceSheet.View.ZoomScale;
int zoomScale = sourceSheet.View.ZoomScale;
if (zoomScale >= 10 && zoomScale <= 400)
{
targetSheet.View.ZoomScale = zoomScale;
}
}
}