FormulaEngineer examples
Create, read, and style Excel workbooks in .NET.
Style workbooks as you write them — fonts, fills, borders,
number formats, alignment, and layout — using
ExcelStyledWriter. Every example below is a complete,
runnable snippet.
Group
Cells and text
10
Layout
10
Conditional formatting
6
Named styles and themes
4
Tables and notes
10
Images and shapes
4
Charts and sparklines
6
Dashboards
4
Example
6
examples
in Conditional formatting
Data bars on a score column
EnableConditionalFormattingDraws an in-cell bar proportional to each value, so the column reads as a bar chart without a helper column or a chart part.
Write.cs
using FormulaEngineer.Api;
using FormulaEngineer.Api.Styling;
var stylingOptions =
new ExcelStylingOptions
{
EnableConditionalFormatting = true
};
using (var writer = new ExcelStyledWriter("data-bar-performance-column.xlsx", null, stylingOptions))
{
using (var sheet = writer.CreateWorksheet("Performance"))
{
sheet.WriteRow("Team", "Score");
sheet.WriteRow("North", 92);
sheet.WriteRow("South", 76);
sheet.WriteRow("West", 64);
sheet.WriteRow("East", 88);
sheet.AddConditionalFormat(
"B2:B5",
ExcelConditionalFormat.DataBar(
ExcelColor.FromRgb(68, 114, 196),
showValue: true));
}
writer.Close();
}
Style your own workbooks
Styling is part of the same package — no separate install, no Excel, no COM automation.