Exemple #1
0
        private void CreateWorkbookStyles()
        {
            CellStyle normalStyle = this.workbook.Styles["Normal"];

            normalStyle.Fill              = PatternFill.CreateSolidFill(new ThemableColor(ThemeColorType.Background1));
            normalStyle.FontFamily        = new ThemableFontFamily(ThemeFontType.Minor);
            normalStyle.FontSize          = UnitHelper.PointToDip(10);
            normalStyle.VerticalAlignment = RadVerticalAlignment.Center;

            CellStyle companyNameStyle = this.workbook.Styles.Add("CompanyNameStyle");

            companyNameStyle.FontFamily          = new ThemableFontFamily(ThemeFontType.Major);
            companyNameStyle.FontSize            = UnitHelper.PointToDip(48);
            companyNameStyle.HorizontalAlignment = RadHorizontalAlignment.Left;

            CellStyle expensePeriodStyle = this.workbook.Styles.Add("ExpensePeriodStyle");

            expensePeriodStyle.FontFamily          = new ThemableFontFamily("Segoe UI Light");
            expensePeriodStyle.FontSize            = UnitHelper.PointToDip(20);
            expensePeriodStyle.HorizontalAlignment = RadHorizontalAlignment.Right;

            CellStyle columnHeadersStyle = this.workbook.Styles.Add("ColumnHeadersStyle");

            columnHeadersStyle.FontFamily   = new ThemableFontFamily(ThemeFontType.Major);
            columnHeadersStyle.BottomBorder = new CellBorder(CellBorderStyle.Thick, new ThemableColor(ThemeColorType.Accent2));
            columnHeadersStyle.FontSize     = UnitHelper.PointToDip(14);

            CellStyle departmentTotalStyle = this.workbook.Styles.Add("DepartmentTotalStyle");

            departmentTotalStyle.CopyPropertiesFrom(normalStyle);
            departmentTotalStyle.FontSize   = UnitHelper.PointToDip(14);
            departmentTotalStyle.FontFamily = new ThemableFontFamily("Segoe UI Light");

            CellStyle totalStyle = this.workbook.Styles.Add("TotalStyle");

            totalStyle.Fill      = PatternFill.CreateSolidFill(new ThemableColor(ThemeColorType.Accent2));
            totalStyle.FontSize  = UnitHelper.PointToDip(14);
            totalStyle.ForeColor = new ThemableColor(ThemeColorType.Background1);
        }