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
4
examples
in Named styles and themes
Rich text in a single cell
EnableRichTextBuilds one cell from three runs so a single word inside the sentence is bold and green — formatting that a cell-level style cannot express, because it applies to the whole cell.
Write.cs
using FormulaEngineer.Api;
using FormulaEngineer.Api.Styling;
var stylingOptions =
new ExcelStylingOptions
{
EnableRichText = true
};
var approvalMessage =
ExcelRichText.From(
new ExcelRichTextRun("Status: "),
new ExcelRichTextRun(
"Approved",
ExcelFontStyle.Default.With(
bold: true,
color: ExcelColor.FromRgb(0, 128, 0))),
new ExcelRichTextRun(" for production export."));
using (var writer = new ExcelStyledWriter("rich-text-approval-message.xlsx", null, stylingOptions))
{
using (var sheet = writer.CreateWorksheet("Approval"))
{
sheet.WriteRow("Review result");
sheet.WriteRow(approvalMessage);
}
writer.Close();
}
Style your own workbooks
Styling is part of the same package — no separate install, no Excel, no COM automation.