Browse Source

weiwu Zjjl Gather

MaiXinRong 8 years ago
parent
commit
b44477f8e0
2 changed files with 10 additions and 16 deletions
  1. 8 15
      DataModules/ReportMemoryDm/rmWeiWuZjjlGatherDm.pas
  2. 2 1
      Units/ReportManager.pas

+ 8 - 15
DataModules/ReportMemoryDm/rmWeiWuZjjlGatherDm.pas

@@ -388,39 +388,32 @@ procedure TrmWeiWuZjjlGatherData.WriteData;
     if ACount < 10 then
       Result := '-%d'
     else if ACount < 100 then
-      REsult := '-%2d'
+      REsult := '-%.2d'
     else if ACount < 1000 then
-      Result := '-%3d'
+      Result := '-%.3d'
     else if ACount < 10000 then
-      Result := '-%4d'
+      Result := '-%.4d'
     else if ACount < 100000 then
-      Result := '-%5d';
-  end;
-
-  function GetFormatStr(AIndex: Integer; const sFormat: string): string;
-  begin
-    Result := Format(sFormat, [AIndex]);
-    Result := StringReplace(Result, ' ', '0', [rfReplaceAll]);
+      Result := '-%.5d';
   end;
 
 var
   i: Integer;
   vZ: TZjjl;
-  sPre, sCode, sFormat: String;
+  sFormat: String;
 begin
   cdsZjjl.Active := True;
   cdsZjjl.EmptyDataSet;
   if FPreText <> '' then
-    sPre := FPreText + GetFormatStr(FPhaseIndex, '-%02d')
+    sFormat := FPreText + Format('-%.2d', [FPhaseIndex]) + GetCodeFormat(FZjjlList.Count)
   else
-    sPre := FPreText + GetFormatStr(FPhaseIndex, '%02d');
-  sFormat := GetCodeFormat(FZjjlList.Count);
+    sFormat := FPreText + Format('%.2d', [FPhaseIndex]) + GetCodeFormat(FZjjlList.Count);
   for i := 0 to FZjjlList.Count - 1 do
   begin
     vZ := TZjjl(FZjjlList.Items[i]);
 
     cdsZjjl.Append;
-    cdsZjjlCode.AsString := sPre + GetFormatStr(i+1, sFormat);
+    cdsZjjlCode.AsString := Format(sFormat, [i+1]);
     cdsZjjlCertificateCode.AsString := vZ.FCertificateCode;
     cdsZjjlBGLCode.AsString := vZ.FBGLCode;
     cdsZjjlPegName.AsString := vZ.FPegName;

+ 2 - 1
Units/ReportManager.pas

@@ -770,7 +770,8 @@ begin
     56: Result := FrmWeiWuZjjlGatherData.AssignData(AProjectData); // 맵據關嶠 -- 데깃뙈、셕좆連마삠悧깊
   end;
   // For Inner Test
-  ShowTestForm(Result);
+  //if _IsDebugView then
+    //ShowTestForm(Result);
 end;
 
 function TMemoryReportManager.GetSqlResultDataSet(const ASql: string;