public void BorderAround(string style, object color)
        {
            ExcelBorderStyle objStyle;

            if (style.TryParseEnum(true, out objStyle) == false)
            {
                throw new JavaScriptException(this.Engine, "Error", "Could not set style: " + style + " is not one of the style options.");
            }

            if (color != null && color != Null.Value && color != Undefined.Value)
            {
                var cc       = new ColorConverter();
                var colorObj = cc.ConvertFromString(TypeConverter.ToString(color));
                if (colorObj is Color)
                {
                    m_border.BorderAround(objStyle, (Color)colorObj);
                }
                else
                {
                    m_border.BorderAround(objStyle);
                }
            }
            else
            {
                m_border.BorderAround(objStyle);
            }
        }
예제 #2
0
 /// <summary>
 /// 设置表头行的边框样式
 /// </summary>
 protected virtual Border SetColumnHeadBorderStyle(Border border)
 {
     border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(191, 191, 191));//设置单元格所有边框
     return(border);
 }