Exemple #1
0
        protected ExportExcelSettingsData RuleFor <TProperty>(Expression <Func <TUiGridModel, TProperty> > expression)
        {
            var exportExcelSettingsData = new ExportExcelSettingsData();

            _exportExcelSettings.Add(expression.GetMember(), exportExcelSettingsData);
            return(exportExcelSettingsData);
        }
Exemple #2
0
        private StringBuilder BuildColumnStyle(ExportExcelSettingsData data, RenderExcelElementType renderExcelElementType)
        {
            StringBuilder buildedStyle = new StringBuilder();

            if (data.TableColumnHeight > 0)
            {
                buildedStyle.AppendFormat($"height: {data.TableColumnHeight}px;");
            }

            if (data.TableColumnWidth > 0)
            {
                buildedStyle.AppendFormat($"width: {data.TableColumnWidth}px;");
            }

            if (renderExcelElementType == RenderExcelElementType.Header)
            {
                buildedStyle.AppendFormat($"text-align: {data.TableHeaderColumnTextAlign.ToString()};");
                if (data.TableHeaderColumnTextAlign == TextAlign.Center)
                {
                    buildedStyle.AppendFormat("vertical-align: middle;");
                }
            }

            if (renderExcelElementType == RenderExcelElementType.Row)
            {
                if (data.RowCellTextAlign == TextAlign.Left)
                {
                    buildedStyle.AppendFormat("vertical-align: top;");
                }
            }

            buildedStyle.AppendFormat($"font-weight: {data.TableHeaderColumnFontWeight.ToString()};");

            if (!String.IsNullOrEmpty(data.CustomStyle))
            {
                buildedStyle.Append(data.CustomStyle);
            }
            return(buildedStyle);
        }
 public static ExportExcelSettingsData CustomStyle(this ExportExcelSettingsData @this, string value)
 {
     @this.CustomStyle = value;
     return(@this);
 }
 public static ExportExcelSettingsData CellTextAlign(this ExportExcelSettingsData @this, TextAlign value)
 {
     @this.RowCellTextAlign = value;
     return(@this);
 }
 public static ExportExcelSettingsData TableHeaderColumnFontWeight(this ExportExcelSettingsData @this, FontWeight value)
 {
     @this.TableHeaderColumnFontWeight = value;
     return(@this);
 }
 public static ExportExcelSettingsData TableHeaderColumnTextAlign(this ExportExcelSettingsData @this, TextAlign value)
 {
     @this.TableHeaderColumnTextAlign = value;
     return(@this);
 }
 public static ExportExcelSettingsData TableColumnHeight(this ExportExcelSettingsData @this, int value)
 {
     @this.TableColumnHeight = value;
     return(@this);
 }