zoukankan      html  css  js  c++  java
  • 锐浪 报表, 交叉报表中 对交叉字段,做条件改变背景颜色 .

    锐浪 报表, 交叉报表中 对交叉字段,做条件改变背景颜色 .

    var fieldCount = Report.RunningDetailGrid.ColumnContent.ContentCells.Count;    // 总字段列数
    var lockFieldCount = Report.DetailGrid.CrossTab.ListCols;      // 锁定字段列数
    var crossFieldCount = fieldCount - lockFieldCount;
    
    
    
    for(var colIndex = 1; colIndex <=crossFieldCount;colIndex++)
    {
        var crossFieldName = "Amount_" + colIndex;
        var AmountContentCell = Report.RunningDetailGrid.ColumnContent.ContentCells.Item(crossFieldName);
        var cellName = AmountContentCell.DataField;
        var AmountField =Report.RunningDetailGrid.Recordset.Fields.Item(cellName);
    
        var FontBold = false;
        var FontItalic = false;
        var TextColor;
        var BackColor;
    
        if (AmountField.AsFloat > 450)
        {
            FontBold = true;
            FontItalic = true;
            TextColor = GetColorValue(0, 255, 0);
            BackColor = GetColorValue(255, 0, 0);
        }else{
            TextColor = GetColorValue(0, 0, 0);
            BackColor = GetColorValue(255, 255, 255);
        }
        
        SetContentCellBackColor(AmountContentCell,BackColor);
        SetContentCellBold(AmountContentCell,FontBold);
    }
    
    /************************ 函数方法 ******************************/
    
    /**
     * 设置单元格背景颜色
     * @author WUYF
     */
    function SetContentCellBackColor(oContentCell,backColor)
    {
          oContentCell.BackColor = backColor;
    }
    
    /**
     * 设置单元格内容粗体
     * @author WUYF
     */
    function SetContentCellBold(oContentCell,isBold)
    {
          oContentCell.Font.Bold = isBold;
    }
    
    
    function GetColorValue(r,g,b)
    {
       return r + g*256 + b*256*256;
    }
  • 相关阅读:
    Django搭建环境
    python切片
    python数据类型
    jquery 淡入淡出属性
    Jquery Tab切换
    jQuery Clone方法
    jQuery属性操作
    python 变量以及循环
    获取网站目录
    posting-jsonobject-with-httpclient-from-web-api
  • 原文地址:https://www.cnblogs.com/wuyifu/p/3793203.html
Copyright © 2011-2022 走看看