瀏覽代碼

Task #1233 报表底纹

MaiXinRong 9 年之前
父節點
當前提交
db2896d7e9
共有 5 個文件被更改,包括 106 次插入9 次删除
  1. 57 9
      Forms/ProjectPropertiesFrm.dfm
  2. 18 0
      Forms/ProjectPropertiesFrm.pas
  3. 3 0
      Forms/ReportsFrm.pas
  4. 6 0
      Units/Connections.pas
  5. 22 0
      Units/ProjectProperty.pas

+ 57 - 9
Forms/ProjectPropertiesFrm.dfm

@@ -1,7 +1,7 @@
 object ProjectPropertiesForm: TProjectPropertiesForm
   Left = 663
   Top = 261
-  ActiveControl = leProjectName
+  ActiveControl = cbShowAlias
   BorderIcons = [biSystemMenu]
   BorderStyle = bsSingle
   Caption = #39033#30446#23646#24615
@@ -120,8 +120,8 @@ object ProjectPropertiesForm: TProjectPropertiesForm
     Top = 63
     Width = 530
     Height = 255
-    ActivePage = jpsPropertiesBase
-    ActivePageIndex = 0
+    ActivePage = jpsPropertiesView
+    ActivePageIndex = 2
     Align = alTop
     Caption = 'jpsProperties'
     object jpsPropertiesBase: TJimPage
@@ -934,13 +934,13 @@ object ProjectPropertiesForm: TProjectPropertiesForm
             Left = 52
             Top = 72
             Width = 349
-            Height = 49
+            Height = 73
             Caption = #20215#24046
             TabOrder = 31
             Visible = False
             object lePM_PriceDigit: TLabeledEdit
-              Left = 49
-              Top = 19
+              Left = 51
+              Top = 43
               Width = 87
               Height = 18
               EditLabel.Width = 36
@@ -951,14 +951,24 @@ object ProjectPropertiesForm: TProjectPropertiesForm
               Text = '0'
             end
             object udPM_PriceDigit: TUpDown
-              Left = 136
-              Top = 19
+              Left = 138
+              Top = 43
               Width = 16
               Height = 18
               Associate = lePM_PriceDigit
               Max = 10
               TabOrder = 1
             end
+            object cbDisplayPM: TCheckBox
+              Left = 11
+              Top = 19
+              Width = 166
+              Height = 17
+              Caption = #22635#20889#20215#24046#37329#39069#33267#35745#37327#21488#36134
+              Ctl3D = False
+              ParentCtl3D = False
+              TabOrder = 2
+            end
           end
         end
       end
@@ -1015,6 +1025,19 @@ object ProjectPropertiesForm: TProjectPropertiesForm
         Font.Style = []
         ParentFont = False
       end
+      object leReport: TLabel
+        Left = 7
+        Top = 141
+        Width = 48
+        Height = 12
+        Caption = #25253#34920#24213#32441
+        Font.Charset = ANSI_CHARSET
+        Font.Color = clBlue
+        Font.Height = -12
+        Font.Name = #23435#20307
+        Font.Style = []
+        ParentFont = False
+      end
       object pnlViewBar: TPanel
         Left = 62
         Top = 11
@@ -1027,7 +1050,7 @@ object ProjectPropertiesForm: TProjectPropertiesForm
         Left = 8
         Top = 24
         Width = 505
-        Height = 225
+        Height = 113
         BevelOuter = bvNone
         TabOrder = 1
         object pnlAlias: TPanel
@@ -1144,6 +1167,31 @@ object ProjectPropertiesForm: TProjectPropertiesForm
           end
         end
       end
+      object pnlReport: TPanel
+        Left = 62
+        Top = 147
+        Width = 457
+        Height = 2
+        BevelOuter = bvLowered
+        TabOrder = 2
+      end
+      object cbShowReportShading: TCheckBox
+        Left = 40
+        Top = 160
+        Width = 17
+        Height = 17
+        TabOrder = 3
+        OnClick = cbShowReportShadingClick
+      end
+      object edtReportShading: TEdit
+        Left = 64
+        Top = 160
+        Width = 177
+        Height = 18
+        Ctl3D = False
+        ParentCtl3D = False
+        TabOrder = 4
+      end
     end
   end
   object xpm: TXPMenu

+ 18 - 0
Forms/ProjectPropertiesFrm.pas

@@ -102,6 +102,11 @@ type
     gbPM_Digit: TGroupBox;
     lePM_PriceDigit: TLabeledEdit;
     udPM_PriceDigit: TUpDown;
+    cbDisplayPM: TCheckBox;
+    pnlReport: TPanel;
+    leReport: TLabel;
+    cbShowReportShading: TCheckBox;
+    edtReportShading: TEdit;
     procedure btnOkClick(Sender: TObject);
     procedure leContractPriceClick(Sender: TObject);
     procedure msbBaseMouseWheel(Sender: TObject; Shift: TShiftState;
@@ -124,6 +129,7 @@ type
     procedure leNewUnlockPasswordAgainExit(Sender: TObject);
     procedure leNewUnLockPasswordExit(Sender: TObject);
     procedure leUnlockPasswordExit(Sender: TObject);
+    procedure cbShowReportShadingClick(Sender: TObject);
   private
     FProjectData: TProjectData;
     FStaffData: TStaffData;
@@ -209,6 +215,10 @@ begin
   cbShowBGLCode.Checked := FProjProperties.ShowBGLCode;
   cbShowDesignQuantity.Checked := FProjProperties.ShowDesignQuantity;
   cbShowAlias.Checked := FProjProperties.ShowAlias;
+
+  cbShowReportShading.Checked := FProjProperties.ShowReportShading;
+  edtReportShading.Enabled := cbShowReportShading.Checked;
+  edtReportShading.Text := FProjProperties.ReportShading;
 end;
 
 procedure TProjectPropertiesForm.btnOkClick(Sender: TObject);
@@ -556,6 +566,9 @@ end;
 
 procedure TProjectPropertiesForm.SaveProjectView;
 begin
+  FProjProperties.ShowReportShading := cbShowReportShading.Checked;
+  FProjProperties.ReportShading := edtReportShading.Text;
+
   FProjProperties.ShowPriceChange := cbShowPriceChange.Checked;
   FProjProperties.ShowBGLCode := cbShowBGLCode.Checked;
   FProjProperties.ShowDesignQuantity := cbShowDesignQuantity.Checked;
@@ -564,4 +577,9 @@ begin
   FProjectFrame.RefreshColumnDisplay;
 end;
 
+procedure TProjectPropertiesForm.cbShowReportShadingClick(Sender: TObject);
+begin
+  edtReportShading.Enabled := cbShowReportShading.Checked;
+end;
+
 end.

+ 3 - 0
Forms/ReportsFrm.pas

@@ -768,6 +768,9 @@ begin
   APrintCom.FillZero := chkFillZero.Checked;
   InitPageSettings(APrintCom);
   InitPaperSettings(ATemplate, APrintCom);
+
+  APrintCom.ShowBackgroundMark := FProjectData.ProjProperties.ShowReportShading;
+  APrintCom.BackgroundMarkStr := FProjectData.ProjProperties.ReportShading;
 end;
 
 procedure TReportsForm.InitPageSettings(APrintCom: TPrintComXML);

+ 6 - 0
Units/Connections.pas

@@ -41,6 +41,7 @@ type
     destructor Destroy; override;
 
     procedure Open(const AFileName: string); override;
+    procedure Save; override;
     function HasOpened: Boolean; override;
   end;
 
@@ -551,4 +552,9 @@ begin
   FConnection.Open;
 end;
 
+procedure TCommonConnection.Save;
+begin
+  inherited;
+end;
+
 end.

+ 22 - 0
Units/ProjectProperty.pas

@@ -75,6 +75,8 @@ type
 
     FUpdateFlag: Integer;
     FPriceMarginStartPhaseID: Integer;
+    FShowReportShading: Boolean;
+    FReportShading: string;
 
     function GetBoolPropertyDef(const AName: string; ADef: Boolean): Boolean;
     function GetIntPropertyDef(const AName: string; ADef: Integer): Integer;
@@ -115,6 +117,8 @@ type
     procedure SetQuantityDigit(const Value: Integer);
     procedure SetTotalPriceDigit(const Value: Integer);
     procedure SetUpdateFlag(const Value: Integer);
+    procedure SetReportShading(const Value: string);
+    procedure SetShowReportShading(const Value: Boolean);
   public
     constructor Create(AProjectData: TObject);
     destructor Destroy; override;
@@ -210,6 +214,9 @@ type
     property ShowBGLCode: Boolean read FShowBGLCode write SetShowBGLCode;
     property ShowDesignQuantity: Boolean read FShowDesignQuantity write SetShowDesignQuantity;
     property ShowAlias: Boolean read FShowAlias write SetShowAlias;
+
+    property ShowReportShading: Boolean read FShowReportShading write SetShowReportShading;
+    property ReportShading: string read FReportShading write SetReportShading;
   end;
 
 implementation
@@ -469,6 +476,9 @@ begin
   FShowBGLCode := GetBoolPropertyDef('ShowBGLCode', True);
   FShowDesignQuantity := GetBoolPropertyDef('ShowDesignQuantity', False);
   FShowAlias := GetBoolPropertyDef('ShowAlias', False);
+
+  FShowReportShading := GetBoolPropertyDef('ShowReportShading', False);
+  FReportShading := GetStrPropertyDef('ReportShading', '');
 end;
 
 procedure TProjProperties.Open(AConnection: TADOConnection);
@@ -593,6 +603,12 @@ begin
   FQuantityFormat := GetDisplayFormat(FQuantityDigit);
 end;
 
+procedure TProjProperties.SetReportShading(const Value: string);
+begin
+  FReportShading := Value;
+  FPropertyInqurity.Value['ReportShading'] := Value;
+end;
+
 procedure TProjProperties.SetShowAlias(const Value: Boolean);
 begin
   FShowAlias := Value;
@@ -617,6 +633,12 @@ begin
   FPropertyInqurity.Value['ShowPriceChange'] := Value;
 end;
 
+procedure TProjProperties.SetShowReportShading(const Value: Boolean);
+begin
+  FShowReportShading := Value;
+  FPropertyInqurity.Value['ShowReportShading'] := Value;
+end;
+
 procedure TProjProperties.SetStartedSubsist(const Value: Double);
 begin
   FStartedSubsist := Value;