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
10
examples
in Cells and text
Bold total row with currency format
Closes a table with a filled, bold, right-aligned total row carrying a live SUM formula — showing that a styled cell and a formula cell are the same thing.
Write.cs
using FormulaEngineer.Api;
using FormulaEngineer.Api.Styling;
using FormulaEngineer.Licensing;
var headerStyle =
ExcelStyle.Default.With(
font: ExcelFontStyle.Default.With(
bold: true,
color: ExcelColor.FromRgb(255, 255, 255)),
fill: ExcelFillStyle.Solid(
ExcelColor.FromRgb(31, 78, 121)),
alignment: ExcelAlignmentStyle.Default.With(
horizontal: ExcelHorizontalAlignment.Center));
var currencyStyle =
ExcelStyle.Default.With(
numberFormat: ExcelNumberFormatStyle.Custom("$#,##0.00"));
var totalStyle =
ExcelStyle.Default.With(
font: ExcelFontStyle.Default.With(
bold: true,
color: ExcelColor.FromRgb(255, 255, 255)),
fill: ExcelFillStyle.Solid(
ExcelColor.FromRgb(0, 112, 192)),
numberFormat: ExcelNumberFormatStyle.Custom("$#,##0.00"),
alignment: ExcelAlignmentStyle.Default.With(
horizontal: ExcelHorizontalAlignment.Right));
using (var writer = new ExcelStyledWriter("bold-total-row.xlsx"))
{
using (var sheet = writer.CreateWorksheet("Totals"))
{
sheet.WriteRow(
new object?[] { "Department", "Amount" },
headerStyle);
sheet.WriteRow(
new object?[] { "Engineering", 12500m },
new ExcelStyle?[] { null, currencyStyle });
sheet.WriteRow(
new object?[] { "Operations", 8700m },
new ExcelStyle?[] { null, currencyStyle });
sheet.WriteRow(
new object?[] { "TOTAL", ExcelFormula.From("SUM(B2:B3)") },
new ExcelStyle?[] { totalStyle, totalStyle });
}
writer.Close();
}
Style your own workbooks
Styling is part of the same package — no separate install, no Excel, no COM automation.