用DB交叉表对象,
进行同一行的  两列(1,3)数值进行比较,如果1的数值>3的数值 ,那么3的字体变颜色。请问应该怎么做?

解决方案 »

  1.   

    在fastreport中写脚本,判断这两个字段的值
      

  2.   

    procedure ReportTitle1OnBeforePrint(Sender: TfrxComponent);
    begin
        if DBCross1Row4.Value>DBCross1Row4.Value*1.02 then                  
        DBCross1Row4.Frame.Color := clRed;  
    end;不起作用
      

  3.   

    别用value,直接用字段名去取值试试
      

  4.   

     if <MainDataSet."byBPRICE">><MainDataSet."LOWPRICE">*1.02  then
       DBCross1Row8.Font.Color := clRed;这样取出来了颜色改变的是整列
    呵呵
    我想要的是具体到某个网格里颜色改变
      

  5.   


    procedure DBCross1OnPrintCell(Memo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer; RowValues, ColumnValues, Value: Variant);
    begin
      if ColumnIndex=0 then C1 := Memo.Value;                                
      if (ColumnIndex=2) and (Memo.Value<C1) then
        Memo.Font.Color := clRed;                                                                 
    end;