callm пре 3 дана
родитељ
комит
6b9520d01c
1 измењених фајлова са 6 додато и 7 уклоњено
  1. 6 7
      UAS_MES_ZKLH/FunctionCode/Query/Query_SOP.cs

+ 6 - 7
UAS_MES_ZKLH/FunctionCode/Query/Query_SOP.cs

@@ -189,7 +189,7 @@ namespace UAS_MES_NEW.Query
                                 int newTotalRows = newshe.Cells.MaxDataRow + 1;
                                 int newTotalRows = newshe.Cells.MaxDataRow + 1;
 
 
                                 string newPrintArea = "";
                                 string newPrintArea = "";
-                                if (she.Name == "控制页")
+                                if (totalPages == 0)
                                 {
                                 {
                                     newPrintArea = $"A1:{lastColLetter}{25}";
                                     newPrintArea = $"A1:{lastColLetter}{25}";
                                 }
                                 }
@@ -198,15 +198,15 @@ namespace UAS_MES_NEW.Query
                                     newPrintArea = $"A1:{lastColLetter}{newTotalRows}";
                                     newPrintArea = $"A1:{lastColLetter}{newTotalRows}";
                                     //newPrintArea = $"A1:{lastColLetter}{dataRowsPerPage}";
                                     //newPrintArea = $"A1:{lastColLetter}{dataRowsPerPage}";
                                 }
                                 }
-                                Console.WriteLine(totalPages+" "+ dataRowsPerPage+" "+ newTotalRows);
-                                Console.WriteLine($"A1:{lastColLetter}{(totalPages == 0 ? dataRowsPerPage : newTotalRows)}");
-                                Console.WriteLine($"A1:{lastColLetter}{dataRowsPerPage}");
+                                //Console.WriteLine(totalPages + " " + dataRowsPerPage + " " + newTotalRows);
+                                //Console.WriteLine($"A1:{lastColLetter}{(totalPages == 0 ? dataRowsPerPage : newTotalRows)}");
+                                //Console.WriteLine($"A1:{lastColLetter}{dataRowsPerPage}");
                                 newshe.PageSetup.PrintArea = newPrintArea;
                                 newshe.PageSetup.PrintArea = newPrintArea;
 
 
                                 newshe.PageSetup.CenterHorizontally = true;
                                 newshe.PageSetup.CenterHorizontally = true;
                                 newshe.PageSetup.CenterVertically = true;
                                 newshe.PageSetup.CenterVertically = true;
                                 newshe.PageSetup.LeftMargin = 2;
                                 newshe.PageSetup.LeftMargin = 2;
-                                newshe.PageSetup.RightMargin = 0;
+                                newshe.PageSetup.RightMargin = 2;
                                 newshe.PageSetup.TopMargin = 2;
                                 newshe.PageSetup.TopMargin = 2;
                                 newshe.PageSetup.BottomMargin = 2;
                                 newshe.PageSetup.BottomMargin = 2;
                                 newshe.PageSetup.SetFooter(0, "");
                                 newshe.PageSetup.SetFooter(0, "");
@@ -215,8 +215,7 @@ namespace UAS_MES_NEW.Query
                                 // ========== 添加图片/水印 ==========
                                 // ========== 添加图片/水印 ==========
                                 if (File.Exists(PrintPath.Text))
                                 if (File.Exists(PrintPath.Text))
                                 {
                                 {
-                                    newshe.Pictures.Clear();
-                                    int rowOffset = headerRows + int.Parse(Y.Value.ToString());
+                                    int rowOffset = int.Parse(Y.Value.ToString());
                                     newshe.Pictures.Add(rowOffset, int.Parse(X.Value.ToString()), PrintPath.Text);
                                     newshe.Pictures.Add(rowOffset, int.Parse(X.Value.ToString()), PrintPath.Text);
                                 }
                                 }