1. Design in Excel
Open any spreadsheet editor — Excel, Google Sheets, LibreOffice, whatever you prefer. Make your report look exactly right. Headers, colors, borders, number formats, logos. Save as .xlsx.
You know that feeling when you open Excel and just make a report look right? The fonts, the colors, the borders — it takes a few minutes and it looks professional. Now imagine dropping a Go library into your project that fills that template with live data. That’s XLFill.
Here’s a template you’d design:
And here’s what XLFill produces:
Same fonts. Same colors. Same borders. You didn’t write a single line of code for any of that styling. The template is the design.
1. Design in Excel
Open any spreadsheet editor — Excel, Google Sheets, LibreOffice, whatever you prefer. Make your report look exactly right. Headers, colors, borders, number formats, logos. Save as .xlsx.
2. Drop in a few annotations
Put ${employee.Name} in cells where data should go. Add a jx:each(...) command in a cell comment to define a loop. That’s it — two things to learn.
3. Fill from Go
One function call: xlfill.Fill("template.xlsx", "output.xlsx", data). Your data flows into the template. Every pixel of formatting — preserved.
4. Ship it
Your users get a real .xlsx file. Opens in Excel, Google Sheets, LibreOffice. Not a CSV. Not an HTML table someone has to squint at. A proper, beautiful spreadsheet.
If you’ve ever built Excel reports in Go (or any language, really), this table will feel painfully familiar:
| The old way (cell-by-cell code) | With XLFill (template-first) | |
|---|---|---|
| How you design | Line by line in Go code | Visually in Excel — like a normal person |
| Changing the layout | Edit code, rebuild, redeploy, pray | Edit the .xlsx file. Done. |
| Who can update it? | Only developers | Anyone who knows Excel |
| Styling & formatting | 20 lines of verbose struct literals per style | It’s already in the template |
| Formulas | Build formula strings by hand | Write them in Excel — XLFill expands them |
| Merged cells | Code the exact ranges | Just merge them in Excel |
| Conditional formatting | Most libraries don’t even support it | It’s in the template — just works |
| Code complexity | Grows with every column, every section | Stays tiny — your code only provides data |
| When something breaks | Good luck debugging fmt.Sprintf("A%d", row+2) | Open the template. Look at it. |
“I used to spend 200 lines of Go code wrestling with cell styles, merging headers, and adjusting column widths. Then one day our finance team redesigned the whole report. I had to rewrite everything. Now? My business analyst designs the template in Excel, and my Go code is 10 lines. When they want changes, they just update the template. I don’t even hear about it.”
That’s the shift. The template becomes the single source of truth for how the report looks. Your code becomes the single source of truth for the data. Nobody steps on each other’s toes.
XLFill isn’t just a quick hack — it’s built for real-world scale:
20 commands, zero styling code
Loops, conditionals, charts, tables, conditional formatting, data validation, sparklines, grouping, sheet protection, page breaks, freeze panes — all configured in the template. Your Go code only provides data.
18 built-in functions
Text transforms, number/date formatting, aggregation (sumBy, avgBy, countBy), null-safe helpers, hyperlinks, cell comments, and i18n — all usable directly in ${"{}"} expressions.
Streaming & parallel
WithStreaming(true) for 3x speed and 60% less memory. WithParallelism(4) for concurrent loops. WithAutoMode(hint) picks the best strategy automatically. Generate 100K-row workbooks without breaking a sweat.
Production-grade errors
Every error tells you what went wrong (Template / Data / Runtime), where (cell reference), and how to fix it. Pre-fill validation, data contract checks, and “did you mean?” suggestions.
Invoices
Line items, tax calculations, company logo, conditional formatting for overdue amounts. Invoice generation →
Financial Reports
P&L statements, budget summaries, charts, sparklines, collapsible department groups. Financial reports →
Data Exports
Database queries and API responses to Excel with auto-filter tables and streaming for 100K+ rows. Data exports →
Excel APIs
Serve .xlsx downloads from HTTP endpoints with zero temp files. One-liner handler. Excel export APIs →
See the full case
Read Why XLFill? — a detailed breakdown with real Go code showing 40+ lines of hard-coded pain reduced to 3 lines.
Just try it
Get started — install, build a template, fill it with data. Five minutes, start to finish.
Coming from JXLS (Java)
Same jx: syntax, 12 more commands, Go performance. Your templates work as-is. Migration guide →
Coming from Python
Moving from openpyxl or XlsxWriter? Template-first means less code and better separation of concerns. Python guide →
Choosing a Go library?
excelize, tealeg/xlsx, go-xlsx-templater, or XLFill? See the same report built with each. Comparison →