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 Layout
Column default currency style
Attaches a style to the column itself rather than to each cell, so every value written into that column picks up the currency format without a per-cell style array.
Write.cs
using FormulaEngineer.Api;
using FormulaEngineer.Api.Styling;
var currencyStyle =
ExcelStyle.Default.With(
numberFormat: ExcelNumberFormatStyle.Custom("$#,##0.00"),
alignment: ExcelAlignmentStyle.Default.With(
horizontal: ExcelHorizontalAlignment.Right));
using (var writer = new ExcelStyledWriter("column-default-currency-style.xlsx"))
{
using (var sheet = writer.CreateWorksheet("Budget"))
{
sheet.SetColumnStyle(1, ExcelColumnStyle.Default.With(width: 18d));
sheet.SetColumnStyle(2, ExcelColumnStyle.Default.With(width: 14d, style: currencyStyle));
sheet.SetColumnStyle(3, ExcelColumnStyle.Default.With(width: 14d, style: currencyStyle));
sheet.WriteRow("Department", "Budget", "Actual");
sheet.WriteRow("Engineering", 50000m, 47250m);
sheet.WriteRow("Marketing", 25000m, 26890m);
sheet.WriteRow("Operations", 30000m, 29110m);
}
writer.Close();
}
Style your own workbooks
Styling is part of the same package — no separate install, no Excel, no COM automation.