EPPlus 5/6/7

Features and technical overview

Themes

EPPlus

EPPlus supports themes from version 5 and up. Themes can be handled and loaded via the ThemeManager class exposed by the ExcelPackage.Workbook Property. The ThemeManager can load .thmx files(exported from Excel) and apply them to a workbook. The ThemeManager also supports creating themes with code.

        
using(var package = new ExcelPackage()
{
    package.Workbook.ThemeManager.Load(new FileInfo("integral.thmx"));

    //Themes can also be altered, for use this code to set the Accent1 color. 
    package.Workbook.ThemeManager.CurrentTheme.ColorScheme.Accent1.SetRgbColor(Color.FromArgb(32, 78, 224));    //Blue color
}
            
        

Adding a theme to your workbook will change the appearance of your workbook. For example the fonts and the styles of drawing objects.

Here are some screenshorts from sample 15 in our sample project.

A Bubble chart sheet with the standard office theme
A Bubble chart with the integral theme
        
            //The theme is applied when setting the chart style of the bubble chart.
            chart.StyleManager.SetChartStyle(ePresetChartStyleMultiSeries.BubbleChartStyle10);
        
        
A Radar chart with the standard office theme
A Radar chart with the integral theme

!

See also