Home > Back-end >  Data control indicators to judge, according to the above indicators, below indicators, in line with
Data control indicators to judge, according to the above indicators, below indicators, in line with

Time:10-08


As shown in figure, the table is generated by cross table, to achieve the effect of the following:
1. If lower than the control indicators showing blue,
2. If higher than the control indicators showing red,
3. If, within the scope of control target, according to black,

In addition, each data has a state audit, has been careful data shows a white background, not judge according to the orange,

How effectively to finish above,

CodePudding user response:

First determine what controls you use according to these data, then how to display different color,

CodePudding user response:

Hello, use DBGrid or DBGridEh

CodePudding user response:

The
refer to the original poster hontim response:

As shown in figure, the table is generated by cross table, to achieve the effect of the following:
1. If lower than the control indicators showing blue,
2. If higher than the control indicators showing red,
3. If, within the scope of control target, according to black,

In addition, each data has a state audit, has been careful data shows a white background, not judge according to the orange,

Above, how to complete it efficiently



reference 1st floor Oraclers response:
first determine what controls you use according to these data, then, how to display different color


Hello, use DBGrid or DBGridEh

CodePudding user response:

Procedure TForm1. DBGridEh2DrawColumnCell (Sender: TObject;
Const the Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
The begin
If VarAsType (Column. Field. The Value of varString)='Safety Knife' then
The begin
DBGridEh2. Canvas. The Font Color:=clRed;//font color
DBGridEh2. Canvas. Brush. Color:=clMoneyGreen; The background color
End
Else if VarAsType (Column. Field. The Value of varString)='Flashlight' then
DBGridEh2. Canvas. The Font Color:=clBlue
The else
DBGridEh2. Canvas. The Font Color:=clBlack;
DBGridEh2. DefaultDrawColumnCell (the Rect, DataCol, the Column, the State);
end;

Give you an example reference, you need a specific color and judge oneself can refer to the above content,
  • Related