ount:=ProductsState [Indx] .InvoiceCount + DM.ADOQuery. FieldValues ??[ IbCount ] ;;. ADOQuery. Next ;;
{}. ColCount:=5 ;. RowCount:=Length (ProductsState) +2 ;. Cells [0, 0]:= № raquo ;;. Cells [1, 0]:= Устаткування raquo ;;. Cells [2, 0]:= Реалізовано raquo ;;. Cells [3, 0]:= Заплануйте. Raquo ;;. Cells [4, 0]:= Залишок raquo ;;. ColWidths [0]:=25 ;. ColWidths [1]:=257 ;. ColWidths [2]:=60 ;. ColWidths [3]:=60 ;. ColWidths [4]: ??= 60; i:=0 to Length (ProductsState) - 1 do begin. Cells [0, i + 1]:=IntToStr (i + 1) ;. Cells [1, i + 1]:=ProductsState [i] .Product ;. Cells [2, i + 1]:=FloatToStr (ProductsState [i] .InvoiceCount) ;. Cells [3, i + 1]:=FloatToStr (ProductsState [i] .PlanCount) ;. Cells [4, i + 1]:=FloatToStr (ProductsState [i] .PlanCount-ProductsState [i] .InvoiceCount) ;;
{}:=0;:=0 ;. Clear ;. Clear; i:=0 to Length (ProductsState) - 1 do begin:=Sum1 + ProductsState [i] .InvoiceCount;:=Sum2 + ProductsState [i] .PlanCount ;. Add (ProductsState [i] .InvoiceCount, Copy (ProductsState [i] .Product, 1, 100)) ;. Add (ProductsState [i] .PlanCount-ProductsState [i] .InvoiceCount, Copy (ProductsState [i] .Product, 1, 100)) ;;
{}. Clear; Sum1 gt; 0 then Series3. Add (Sum1, Прийнято raquo ;, clGreen); Sum2-Sum1 gt; 0 then Series3. Add (Sum2-Sum1, Залишок raquo ;, clRed) ;;
TFormMain. PrintGrid (sGrid: TStringGrid; sTitle: string) ;, X2: Integer ;, Y2: Integer ;: Integer ;: Integer ;: TRect ;. Title:=sTitle ;. BeginDoc ;. Canvas. Pen. Color:=0 ;. Canvas. Font. Name:= Times New Roman raquo ;;. Canvas. Font. Size:=12 ;. Canvas. Font. Style:=[fsBold, fsUnderline] ;. Canvas. TextOut (0, 100, Printer. Title); F:=1 to sGrid. ColCount - 1 do:=0; TmpI:=1 to (F - 1) do:=X1 + 5 * (sGrid. ColWidths [TmpI]);:=300;:=0; TmpI:=1 to F do: =X2 + 5 * (sGrid. ColWidths [TmpI]);:=450;:=Rect (X1, Y1, X2 - 30, Y2) ;. Canvas. Font. Style:=[fsBold] ;. Canvas. Font. Size:=7 ;. Canvas. TextRect (TR, X1 + 50, 350, sGrid. Cells [F, 0]) ;. Canvas. Font. Style:=[]; TmpI:=1 to sGrid. RowCount - 1 do:=150 * TmpI + 300;:=150 * (TmpI + 1) + 300;:=Rect (X1, Y1, X2 - 30, Y2) ;. Canvas. TextRect (TR, X1 + 50, Y1 + 50, sGrid. Cells [F, TmpI]) ;;;. EndDoc ;;
TFormMain. StringGrid1DrawCell (Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState) ;: TDateTime;:=Now; ARow gt; 0 then begin. Canvas. Brush. Color:=clWhite; StringGrid1. Cells [3, ARow] lt; gt; then beginStrToDate (StringGrid1. Cells [3, ARow]) - D lt;=Period1 then StringGrid1. Canvas. Brush. Color:=clRedif StrToDate (StringGrid1. Cells [3, ARow]) - D lt;=Period2 then StringGrid1. Canvas. Brush. Color:=clGreen ;;. Canvas. FillRect (Rect) ;. Canvas. TextOut (Rect. Left, Rect. Top, StringGrid1. Cells [ACol, ARow]) ;;;
.