Przeglądaj źródła

定制报表换行,删除旧报表。

Chenshilong 8 lat temu
rodzic
commit
bf431a6894
2 zmienionych plików z 19 dodań i 15 usunięć
  1. 17 13
      DataModules/ReportManagerDM.pas
  2. 2 2
      Forms/ReportManagerFrm.dfm

+ 17 - 13
DataModules/ReportManagerDM.pas

@@ -223,7 +223,7 @@ var
   FOnlineAry, VersArr: TOVArr;
   vHead7: TScFile7Head;
   vSL: TStringList;
-  sProp, sURL, sIDs, sArea: string;
+  sProp, sURL, sIDs, sArea, sFile: string;
   vFS: TFileStream;
 begin
   if FList.Count > 0 then
@@ -237,7 +237,8 @@ begin
     begin
       if (SRec.Attr and faDirectory) = 0 then
       begin
-        vFS := TFileStream.Create(FPath + SRec.Name, fmOpenRead);
+        sFile := FPath + SRec.Name;
+        vFS := TFileStream.Create(sFile, fmOpenRead);
         try
           vFS.Read(vHead7, SizeOf(vHead7));
         finally
@@ -245,18 +246,21 @@ begin
         end;
 
         SetString(sProp, vHead7.ReportProperties, 256);
-        if sProp <> '' then
+        if Pos('报表ID=', sProp)> 0 then
         begin
           vSL.Text := sProp;
+          vReport := TReport.Create;
+          vReport.Owner := Self;
+          vReport.ID := StrToInt(vSL.Values['报表ID']);
+  //        vReport.Category := vSL.Values['分类名称'];   // 分类不取本地文件,取线上的。
+          vReport.FileName := SRec.Name;
+          vReport.LocalVer := vSL.Values['版本'];
+          FList.Add(vReport);
+        end
+        else
+        begin
+          DeleteFile(PChar(sFile));
         end;
-
-        vReport := TReport.Create;
-        vReport.Owner := Self;
-        vReport.ID := StrToInt(vSL.Values['报表ID']);
-//        vReport.Category := vSL.Values['分类名称'];   // 分类不取本地文件,取线上的。
-        vReport.FileName := SRec.Name;
-        vReport.LocalVer := vSL.Values['版本'];
-        FList.Add(vReport);
       end;
       iRetval := FindNext(SRec);
     end;
@@ -340,7 +344,7 @@ begin
           vReport.Area := FOnlineAry[i, 2];
           vReport.NewestVer := FOnlineAry[i, 3];
           vReport.Category := FOnlineAry[i, 5];
-          vReport.NewestMemo := FOnlineAry[i, 6];
+          vReport.NewestMemo := ReplaceChars(FOnlineAry[i, 6]);
           vReport.LocalVer := '';
 
           FList.Add(vReport);
@@ -744,7 +748,7 @@ begin
           vReport.Area := FOnlineAry[i, 2];
           vReport.NewestVer := FOnlineAry[i, 3];
           vReport.Category := FOnlineAry[i, 5];
-          vReport.NewestMemo := FOnlineAry[i, 6];
+          vReport.NewestMemo := ReplaceChars(FOnlineAry[i, 6]);
           vReport.LocalVer := '';
 
           FList.Add(vReport);

+ 2 - 2
Forms/ReportManagerFrm.dfm

@@ -22,7 +22,7 @@ object ReportManagerForm: TReportManagerForm
     Top = 0
     Width = 841
     Height = 535
-    ActivePage = tsCustom
+    ActivePage = tsLocal
     Align = alClient
     Font.Charset = DEFAULT_CHARSET
     Font.Color = clWindowText
@@ -109,7 +109,7 @@ object ReportManagerForm: TReportManagerForm
           Font.Height = -13
           Font.Name = #24494#36719#38597#40657
           Font.Style = []
-          ItemHeight = 0
+          ItemHeight = 19
           ParentFont = False
           TabOrder = 0
           TabStop = False