You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lightweight, extremely fast and memory efficient Excel (.xlsx) writer for .NET 8.
Streams data directly to file — no XML serialization, no memory footprint.
✨ Features
🚀 Extremely fast — streams data directly to file
💾 Minimal RAM — no data accumulation in memory
📄 Multiple sheets — up to 10 sheets per file
🔀 Auto sheet split — automatically creates new sheets after 1M rows
usingvarew=newExcelWriter("output.xlsx");// Register styles BEFORE any Write callintheaderStyle=ew.AddStyle(newStyleConfig{Bold=true,FillColor="1F4E79",// dark blue backgroundFontColor="FFFFFF",// white textHAlign=HAlign.Center,BorderBottom=true});intamountStyle=ew.AddStyle(newStyleConfig{NumberFormat=NumberFormat.Thousands,// 1,234,567HAlign=HAlign.Right});intdollarStyle=ew.AddStyle(newStyleConfig{NumberFormat=NumberFormat.Thousands,DecimalPlaces=2// 1,234,567.00});// Apply styles using named parameterew.Write("Revenue",1,1,styleIndex:headerStyle);ew.WriteNumber(22954062,1,2,styleIndex:amountStyle);ew.WriteNumber(1234.56,1,3,styleIndex:dollarStyle);
Multiple Sheets
usingvarew=newExcelWriter("report.xlsx",newSheetConfig{Name="Summary"});ew.Write("Summary data",1,1);// Add second sheetintsheet2=ew.AddSheet(newSheetConfig{Name="Details"});ew.Write("Detail data",1,1,sheet2);
Auto Sheet Split (3M+ rows)
usingvarew=newExcelWriter("big_report.xlsx");string[]headers={"ID","Name","Amount","Date"};ew.EnableAutoSheetSplit(sheetNamePrefix:"Data",// → "Data 1", "Data 2", "Data 3"headerRow:headers,// auto-repeat on each new sheetfreezeRows:1,rightToLeft:true);// Write header on first sheet manuallyfor(intcol=1;col<=headers.Length;col++)ew.Write(headers[col-1],col,1);// Write 3 million rows — sheet splitting is automaticfor(introw=2;row<=3_000_001;row++){ew.WriteNumber(row-1,1,row);ew.Write($"Name {row}",2,row);ew.WriteNumber(row*1000.0,3,row);ew.Write("2026/01/01",4,row);}
Auto Column Width
usingvarew=newExcelWriter("output.xlsx");// Must be called BEFORE any Writeew.EnableAutoWidth(maxSampleRows:1000);// sample first 1000 rowsew.Write("Transaction Description",1,1);// ... rest of writes
newSheetConfig{Name="Sheet1",FreezeRows=1,// freeze top N rowsFreezeCols=0,// freeze left N columnsRightToLeft=false,// RTL directionColumnsWidth=newList<double>// manual column widths{10,25,15,12},MergeRanges=newList<MergeRange>// merge cells{newMergeRange(colStart:1,rowStart:1,colEnd:4,rowEnd:1)},FilterRange=newFilterRange(// AutoFiltercolStart:1,rowStart:1,colEnd:13,rowEnd:1)}