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
Hidden columns for internal data
Hides a column carrying internal reference codes while keeping its values in the file, so formulas in visible columns can still reference it.
Write.cs
using FormulaEngineer.Api;
using FormulaEngineer.Api.Styling;
var visibleMoneyStyle =
ExcelStyle.Default.With(
numberFormat: ExcelNumberFormatStyle.Custom("$#,##0.00"));
using (var writer = new ExcelStyledWriter("hidden-columns-for-internal-data.xlsx"))
{
using (var sheet = writer.CreateWorksheet("Report"))
{
sheet.SetColumnStyle(1, ExcelColumnStyle.Default.With(width: 18d));
sheet.SetColumnStyle(2, ExcelColumnStyle.Default.With(width: 14d));
sheet.SetColumnStyle(3, ExcelColumnStyle.Default.With(hidden: true));
sheet.SetColumnStyle(4, ExcelColumnStyle.Default.With(width: 14d));
sheet.WriteRow("Item", "Visible total", "Internal code", "Reviewed total");
sheet.WriteRow(
new object?[] { "License", 998m, "INT-001", ExcelFormula.From("B2") },
new ExcelStyle?[] { null, visibleMoneyStyle, null, visibleMoneyStyle });
sheet.WriteRow(
new object?[] { "Support", 275m, "INT-002", ExcelFormula.From("B3") },
new ExcelStyle?[] { null, visibleMoneyStyle, null, visibleMoneyStyle });
}
writer.Close();
}
Style your own workbooks
Styling is part of the same package — no separate install, no Excel, no COM automation.