By Razi Syed. Sample code: github.com/dotnetreport/dotnetreport-aspnetcore-quickstart
Sooner or later every SaaS product gets the same ticket: "customers want to build their own reports." Someone on the team says "we could just build that," someone else says "there are products for that," and the discussion turns into opinions about vendor lock-in versus not-invented-here.
I'd rather settle it with arithmetic. I build Dotnet Report (disclosure: I work on it, so weigh my view accordingly), and I've watched plenty of teams make this call both ways. Building is sometimes the right answer. This article lays out a cost model you can fill in with your own numbers, the parts of the build that tend to be underestimated, and the questions that should push you one way or the other.
Version one is genuinely small
Let's be fair to the build option. The first version of "custom reports" really can be an afternoon: a whitelist of fields, a few filters, a parameterised query, a table on screen.
// A deliberately minimal "report builder" endpoint. static readonly Dictionary<string, string> AllowedColumns = new() { ["customer"] = "c.Name", ["orderDate"] = "o.OrderDate", ["total"] = "o.Total" }; app.MapPost("/reports/run", async (ReportRequest req, ClaimsPrincipal user, IDbConnection db) => { var cols = req.Columns .Where(AllowedColumns.ContainsKey) .Select(c => $"{AllowedColumns[c]} AS [{c}]"); var sql = $@"SELECT {string.Join(", ", cols)} FROM Orders o JOIN Customers c ON c.Id = o.CustomerId WHERE o.TenantId = @tenantId AND o.OrderDate BETWEEN @from AND @to"; return await db.QueryAsync(sql, new { tenantId = user.FindFirst("tenant_id")!.Value, from = req.From, to = req.To }); }); record ReportRequest(string[] Columns, DateTime From, DateTime To); That's honest, safe code: columns come from a whitelist, values are parameters, and the tenant comes from the server-side identity rather than the request. If your users' needs stop here, build it. You don't need a product for a column picker over one table.
The trouble is that this endpoint is the cheapest part of the system, and its existence makes the next requests feel cheap too.
What the backlog looks like after launch
Once users can pick columns, the requests that follow are predictable, and each one is a real piece of engineering:
- Joins across more tables — which means modelling relationships, join types and friendly names, not hard-coding one
FROMclause. - Grouping and aggregates —
SUM,COUNT,AVGby month or by customer, plus totals and sub-totals. - Filters of every type — dates with relative ranges ("last 30 days"), dropdowns populated from lookups, "is blank", "in list".
- Charts — bar, line, pie, and someone will ask for a map.
- Saved reports, folders and sharing — persistence, ownership, and who can see what.
- Exports — PDF, Excel, Word and CSV, each of which needs to look right.
- Scheduling — "email me this every Monday", which I covered in Scheduled PDF and Excel report emails in ASP.NET Core with Quartz.NET.
- Dashboards — several reports on one page.
- Security that survives all of the above — tenant filtering has to be applied to every generated query, every export and every scheduled run, not just the one endpoint you wrote first. That's the subject of Multi-tenant reporting in ASP.NET Core: row-level security your users can't bypass.
- Database protection — timeouts, paging, and keeping ad hoc queries off your primary.
None of these is hard on its own. The cost comes from the combinations: a grouped, filtered, multi-table report exported to Excel on a schedule for a tenant-scoped user is where SQL generation, rendering and security all meet, and that's where the bugs live.
The cost model
Here's the model I use. It's in C# because it makes the inputs explicit; it works just as well in a spreadsheet. Everything is in engineer-weeks so salaries stay out of it until the end.
record BuildOption( double InitialWeeks, // MVP: builder UI, query generation, saved reports double FeatureWeeksPerYear, // the backlog above, as users discover it double MaintenanceWeeksPerYear, // bugs, DB/driver upgrades, UI framework upgrades double SecurityReviewWeeksPerYear); record BuyOption( double IntegrationWeeks, // auth wiring, tenant/role mapping, schema curation, styling double MaintenanceWeeksPerYear, // version upgrades, re-curating schema as it changes decimal LicensePerYear); static (double buildWeeks, double buyWeeks, decimal buyLicense) Compare( BuildOption b, BuyOption v, int years) => ( b.InitialWeeks + years * (b.FeatureWeeksPerYear + b.MaintenanceWeeksPerYear + b.SecurityReviewWeeksPerYear), v.IntegrationWeeks + years * v.MaintenanceWeeksPerYear, v.LicensePerYear * years ); Multiply the weeks by your loaded cost per engineer-week and compare against the license line. Three things make this model honest rather than a sales tool:
- Use a multi-year horizon. Reporting is never "done". A one-year comparison flatters building because the initial build dominates and the backlog hasn't arrived yet.
- Don't set the buy-side maintenance to zero. You still upgrade the package, keep the reporting schema in sync with your database, and support your users. It's smaller, not absent.
- Price the opportunity cost separately. The weeks your team spends on a report builder are weeks not spent on the product your customers chose you for. That's often the deciding number, and it's yours to estimate.
I'm deliberately not giving you default values: they vary too much between teams, and any number I put here would be marketing. Fill it in with your own estimates, then ask the engineer who'll own the feature to add up the backlog list above.
What "buy" actually costs you in integration
The buy side isn't free either, so here's what integrating an embedded tool looks like in practice, using Dotnet Report as the concrete example. The report builder runs inside your ASP.NET Core app, and the main integration point is a single method in the API controller that tells it who the current user is:
public DotNetReportSettings GetSettings() { var settings = new DotNetReportSettings { ApiUrl = _configuration.GetValue<string>("dotNetReport:apiUrl"), AccountApiToken = _configuration.GetValue<string>("dotNetReport:accountApiToken"), DataConnectApiToken = _configuration.GetValue<string>("dotNetReport:dataconnectApiToken") }; settings.ClientId = User.FindFirst("tenant_id")?.Value ?? ""; // tenant settings.UserId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value ?? ""; settings.CurrentUserRole = User.FindAll(ClaimTypes.Role).Select(c => c.Value).ToList(); settings.CanUseAdminMode = ClaimsHelper.HasAnyRequiredClaim(User, ClaimsStore.AllowAdminMode); settings.DataFilters = new { TenantId = settings.ClientId }; // row-level filter, mapped to columns in setup return settings; } Beyond that, the integration work is mostly curation: choosing which tables and views users can see and giving them friendly names on the /dotnetsetup screen, mapping your roles, and styling the front-end to match your app. The report-builder front-end is source-available on GitHub, so you can read and change how it behaves rather than treating it as a black box.
You should also understand the architecture you'd be adopting. In Dotnet Report's case, report definitions, folders and schema configuration are managed through its hosted API (the dotNetReport:apiUrl setting), while the queries themselves run inside your application against your own connection string, so your data stays in your database. The generated SQL comes back encrypted and is decrypted with your privateApiToken before it executes. Whatever you evaluate, ask the equivalent questions: where do report definitions live, where do queries run, and what happens to your reports if you stop paying.
When building is the right call
I'd build, and I'd tell a customer to build, when:
- The reports are fixed. If users need ten known reports with a few filters, that's a feature, not a report builder. Write the ten reports.
- The data isn't relational. If your data lives in a search index, a time-series store or an event stream, a SQL-based report builder is the wrong shape.
- Reporting is your product. If analytics is what customers pay you for, you want to own every pixel and every query plan.
- You can't accept an external dependency for report metadata, for regulatory or contractual reasons. Check that before you evaluate anything.
When buying is the right call
Buying tends to win when:
- Users want genuinely ad hoc reports: their own columns, joins, groupings and charts, and they'll keep asking for more.
- You're multi-tenant and need tenant isolation to be applied consistently across the builder, exports and schedules.
- The backlog list above made you wince, especially exports, scheduling and dashboards.
- Reporting is table stakes, not differentiation. Customers expect it, but nobody chooses you because of it.
For .NET teams in that position, I think Dotnet Report is the best .NET-native option, because it plugs into an ASP.NET Core app the way the code above shows, rather than running as a separate BI server. There are other good embedded-analytics and BI tools with different architectures, and it's worth evaluating them against the same cost model.
A practical way to decide
Run the model with two horizons, one year and three years. If building wins both, build, and start with the minimal endpoint at the top of this article. If buying wins at three years but not one, the real question is whether you believe the backlog will arrive; ask your support queue, not your roadmap. And if you do buy, spend the first week on schema curation and security mapping, because that's where an embedded tool succeeds or fails.
If you want to see how much integration the buy side actually takes, the quickstart sample is a working ASP.NET Core host you can run locally: dotnetreport/dotnetreport-aspnetcore-quickstart. The walkthrough is in Add self-service ad hoc reporting to an ASP.NET Core app.
Razi Syed builds Dotnet Report, an embedded self-service reporting platform for .NET whose report-builder front-end is source-available on GitHub. He writes about adding reporting and analytics to SaaS products without rebuilding them from scratch.
