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 Charts and sparklines
Line sparklines in a trend table
EnableSparklinesPuts a miniature line chart inside a cell at the end of each row, with markers and high/low points highlighted, so a table carries its own trend column.
Write.cs
using FormulaEngineer.Api;
using FormulaEngineer.Api.Styling;
var stylingOptions =
new ExcelStylingOptions
{
EnableSparklines = true
};
using (var writer = new ExcelStyledWriter("line-sparklines-trend-table.xlsx", null, stylingOptions))
{
using (var sheet = writer.CreateWorksheet("Trends"))
{
sheet.AddSparklineGroup(
ExcelSparklineGroup.Create(
new[]
{
ExcelSparkline.Create("'Trends'!$B$2:$E$2", 2, 6),
ExcelSparkline.Create("'Trends'!$B$3:$E$3", 3, 6),
ExcelSparkline.Create("'Trends'!$B$4:$E$4", 4, 6)
},
type: ExcelSparklineType.Line,
showMarkers: true,
showHighPoint: true,
showLowPoint: true));
sheet.WriteRow("Region", "Jan", "Feb", "Mar", "Apr", "Trend");
sheet.WriteRow("North", 10, 12, 9, 15, null);
sheet.WriteRow("South", 8, 7, 12, 6, null);
sheet.WriteRow("West", 5, 9, 11, 14, null);
}
writer.Close();
}
Style your own workbooks
Styling is part of the same package — no separate install, no Excel, no COM automation.