Skip to content

Replace ReportViewer and RDLC on .NET 8, 9 and 10

Many .NET applications print their invoices, statements and lists with RDLC reports, rendered locally by Microsoft’s ReportViewer control. ReportViewer belongs to .NET Framework, Windows Forms and Web Forms: there is no Microsoft-supported way to render RDLC in ASP.NET Core, in a Linux container or with native AOT. Rewriting every report by hand in another tool is the usual way out, and the slow one.

Tagua converts them instead. tagua import reads an RDLC or RDL report (SSRS and ReportViewer, RDL 2005 to 2016) and writes a Tagua template that loads and renders straight away, with a list of anything that needs a second look. Nothing is dropped silently.

  1. Install the tagua command:

    Terminal window
    dotnet tool install --global Tagua.Cli
  2. Convert the report. Embedded images are written next to the template.

    Terminal
    $ tagua import Invoice.rdlc
    Invoice.report.yaml: converted, with 1 file(s).
    1 thing(s) to review (placeholders in the template are marked [RDLC ...]):
    - Textbox 'Custom': The expression =Code.Greeting(First(Fields!CustomerName.Value, "Invoice")) was not converted (custom code (Code.Greeting)).
    1 note(s):
    - Font 'Segoe UI': Tagua does not have this font: declare it under fonts with its files (if its licence allows embedding), or use Selawik, Microsoft's open fallback for Segoe UI (SIL Open Font License), which has the same metrics, so text wraps as in the original. Until then its text uses Helvetica.

    This invoice converted, apart from one expression that calls custom code (Code.Greeting) the report does not include. It is left as a visible [RDLC …] placeholder to replace by hand. Code a report does include becomes a Visual Basic class for your application: see custom code.

  3. Look at it, with sample data made up from the field types, rendered again on every save while you work on it:

    Terminal window
    tagua render Invoice.report.yaml --watch --open
    The converted invoice rendered with sample data: the title, company name, invoice number, a table of lines with a total, and the placeholder for the custom-code expression.

    Download the PDF.

The converted template
Invoice.report.yaml
# Converted from Invoice.rdlc by Tagua.Import.
version: 1
title: Invoice
culture: en-US
page: { size: Letter, margins: 54pt 72pt 54pt 72pt }
parameters:
CompanyName: { type: string, label: Company name, default: "='Acme Ltd'" }
ShowNotes: { type: boolean, label: Show notes, default: "=true" }
data:
Invoice:
fields: { InvoiceNumber: string, CustomerName: string, IssueDate: dateTime }
Lines:
fields: { Description: string, Quantity: decimal, UnitPrice: decimal }
styles:
default: { font: Arial, fontSize: 10pt }
linesTableHeader: { background: "#D3D3D3", padding: 2pt, borderBottom: "1pt solid #000000", fontWeight: bold }
body:
dataset: Invoice
reportHeader:
- layout: absolute
height: 28.8pt
content:
- type: text
x: 0pt
y: 0pt
width: 216pt
value: Invoice
padding: 2pt
font: Segoe UI
fontSize: 18pt
fontWeight: bold
color: "#1F3864"
- type: text
x: 324pt
y: 0pt
width: 144pt
value: "No. {First(InvoiceNumber, 'Invoice')}"
padding: 2pt
align: right
- layout: absolute
height: 18pt
padding: 14.4pt 0 0 0
content:
- type: text
x: 0pt
y: 0pt
width: 252pt
value: "Bill to: {First(CustomerName, 'Invoice')}"
padding: 2pt
- type: text
x: 324pt
y: 0pt
width: 144pt
value: "{First(IssueDate, 'Invoice'):d}"
padding: 2pt
align: right
- layout: absolute
height: 1pt
padding: 7.2pt 0 0 0
content:
- { type: line, x: 0pt, y: 0pt, width: 468pt, stroke: "0.75pt solid #696969", tag: artifact }
- padding: 18pt 0 0 0
content:
- type: table
dataset: Lines
sort: [Description]
columns:
- { header: Description, value: "{Description}", width: 252pt, padding: 2pt }
- { header: Qty, value: "{Quantity:0.##}", width: 54pt, padding: 2pt, align: right }
- { header: Unit price, value: "{UnitPrice:C2}", width: 79.2pt, padding: 2pt, align: right }
- { header: Amount, value: "{Quantity * UnitPrice:C2}", width: 82.8pt, padding: 2pt, align: right }
headerStyle: linesTableHeader
footer:
- cells:
- { value: Total, padding: 2pt, fontWeight: bold, span: 3 }
- value: "{Sum(Quantity * UnitPrice):C2}"
padding: 2pt
borderTop: "1pt solid #000000"
fontWeight: bold
align: right
width: 468pt
- layout: absolute
height: 18pt
padding: 18pt 0 0 0
content:
- type: text
x: 0pt
y: 0pt
width: 468pt
value: Thank you for your business.
padding: 2pt
italic: true
color: "#808080"
visible: "=ShowNotes"
- layout: absolute
height: 18pt
padding: 10.8pt 0 0 0
content:
- type: text
x: 0pt
y: 0pt
width: 468pt
value: "[RDLC: =Code.Greeting(First(Fields!CustomerName.Value, \"Invoice\"))]"
padding: 2pt
pageHeader:
- layout: absolute
height: 43.2pt
content:
- type: image
x: 0pt
y: 0pt
width: 72pt
height: 36pt
source: images/Logo.png
fit: contain
alt: Acme logo
- type: text
x: 324pt
y: 7.2pt
width: 144pt
value: "{CompanyName}"
padding: 2pt
fontWeight: bold
align: right
detail: []
pageFooter:
- layout: absolute
height: 28.8pt
content:
- type: text
x: 324pt
y: 7.2pt
width: 144pt
value: "Page {PageNumber} of {TotalPages}"
padding: 2pt
fontSize: 8pt
align: right

Two complete examples, a sales invoice and a sales matrix, are on RDLC migration examples.

Give tagua import a folder, and it converts every RDLC and RDL report in it and its subfolders, then sums them up: a line for each report, how many need nothing reviewed, and the items most of them share. It writes the same summary to tagua-import-summary.md, with each report’s list, to plan the migration by.

$ tagua import reports --out converted
Invoice.rdlc: 1 item to review (1 note(s)).
InvoiceList.rdlc: nothing to review.
Legacy2005.rdlc: 2 items to review (2 note(s)).
SalesByCategory.rdlc: 1 item to review (1 note(s)).
SalesMatrix.rdlc: nothing to review.
5 report(s): 5 converted.
Nothing to review: 2 (40%)
One item or none: 4 (80%)
Five items or fewer: 5 (100%)
Most common items to review (reports that have them):
…
converted/tagua-import-summary.md: written, with each report's items.

The most common items come as a list, each with the number of reports that have it, so that one fix can be planned for all of them. An item to review needs a person: a placeholder, or something converted differently. A note needs nothing, or only something from your application, such as the rows or a font’s files. Reports in one folder that each embed their own Logo keep their own: the later ones are written as images/Invoice-Logo.png and so on, and their templates refer to them.

In ReportViewer, data came in as ReportDataSources named after the report’s datasets. In Tagua the template’s data section keeps those names (Invoice and Lines here), and you pass rows under the same names, from memory or straight from a database reader:

var report = CompiledReport.Compile(TemplateLoader.LoadFile("Invoice.report.yaml"));
var inputs = new ReportInputs
{
Parameters = new Dictionary<string, object?> { ["CompanyName"] = "Contoso Ltd" },
Data = new Dictionary<string, IDataSet>
{
["Invoice"] = DataSources.FromRows([invoice]),
["Lines"] = DataSources.FromDataReader(async ct =>
{
var command = connection.CreateCommand();
command.CommandText = "select Description, Quantity, UnitPrice from InvoiceLines where InvoiceId = @id";
command.Parameters.Add(new SqlParameter("@id", invoiceId));
return await command.ExecuteReaderAsync(ct);
}),
},
Resources = new DirectoryResourceResolver("reports"),
};
await using var pdf = File.Create("invoice.pdf");
await Reports.RenderPdfAsync(report, inputs, pdf);

It runs anywhere .NET 10 runs: ASP.NET Core, a worker, a Linux container, native AOT.

We don’t only test the converter on reports we wrote ourselves. We collected about 6,000 .rdlc files from public GitHub repositories and ran every one through it: 4,759 reports from 1,415 .NET projects, and 1,230 from Business Central extensions. Each report was converted, filled with sample rows, laid out and rendered to PDF. The figures are for Tagua 0.22.0, in September 2026.

.NET reports
Convert and render without an error 4,757 of 4,759 (99.96%)
Nothing to review 71%
One item to review, or none 85%
Five items or fewer 96%

“Nothing to review” means the converter left no placeholder and listed nothing but notes: about fonts and layout, and about values your application supplies, such as the user’s name. The Business Central reports all convert and render too.

The most common items left are tablixes with column groups that do not fit a matrix, subreports to convert along with the report, tables in a group that list all their dataset’s rows, and styles computed rather than chosen. Every item is listed, and the report still renders around it.

  • Data: datasets and their fields with types, report parameters with prompts and defaults (from a dataset too). A field with no declared type, or declared as text but summed, takes the type the report uses it as.
  • Page: size, orientation, margins, language, page header and footer.
  • Items: text boxes with their formatting and Format (a constant, or an expression such as a field), HTML placeholders (bold, italic, colours and line breaks), images (embedded, external, and from fields or base64 text), lines, rectangles, visibility (Hidden; an item a drill-down toggle opens shows as it starts, as ReportViewer’s PDF export shows it), bookmarks.
  • Data regions: tables (with several detail rows, and their own row groups with headings and subtotals), the first grouped table or list as the report’s groups (with group headers, footers and page breaks), lists (RDL 2005 lists too), matrices (cross-tabs, with their row and column groups and totals, in the RDL 2005 format too), charts (column, bar, line, area, pie, doughnut, with or without a category group, in the RDL 2005 format too), subreports, and tables that only lay out fixed cells.
  • Styles from expressions: a style that picks among constants, such as =IIf(Fields!Amount.Value < 0, "Red", "Black") or zebra stripes by RowNumber, becomes Tagua’s conditional styles; a colour, font, size or weight taken from a field, parameter or report variable is computed as the report fills.
  • Expressions, translated from Visual Basic: fields, parameters and report variables, Globals, User!UserID (a UserID parameter your application passes), aggregates with their scope, running totals (RunningValue, RowNumber), IIf and Switch, formatting, conversion, string, date and math functions, and the operators. A concatenation such as ="Page " & Globals!PageNumber becomes the text template Page {PageNumber}.
  • References to other text boxes (ReportItems!Name.Value) take that text box’s expression: in the same table row, and in the page header and footer, which read the page’s first and last rows. A document’s values carried to the page header in one hidden text box, Choose(3, Split(CStr(ReportItems!Values.Value), Chr(177))), become the value itself.

A report’s Code holds Visual Basic functions its expressions call. Tagua’s expressions do not run Visual Basic, so the converter writes that code out as a class, next to the template (Invoice.Code.vb), and turns Code.GetColor(...) into a call to GetColor(...). Add the file to a Visual Basic class library that references Tagua, and give its functions to the report:

var functions = new InvoiceCode().Register(new ReportFunctions());
var report = CompiledReport.Compile(template, functions);

The Visual Basic compiler builds it with your application, so it behaves as it did in ReportViewer, keeps its state (a row counter, say) and works with native AOT. Arguments are converted as Visual Basic converts them. The converter lists what it could not register (a Sub, ByRef or optional parameters) and code that reads Report.Parameters, which Tagua does not pass: give it what it needs as arguments instead.

These leave an [RDLC …] placeholder and an entry in the list, so you can find and finish them:

  • Previous, Lookup, ReportItems!… across table rows or to a text box that sums its rows, and custom code functions the converter could not register;
  • tables that list rows, matrices and charts inside table cells (a table there that only lays out fixed cells converts); matrices with detail rows or groups side by side (plain matrices convert, with their totals);
  • other chart types, gauges, maps, data bars and indicators;
  • dataset filters and calculated fields (supply the rows filtered and computed).

RDLC reports name fonts installed on Windows. Arial, Times New Roman and Courier New need nothing: Tagua draws them with the standard PDF fonts Helvetica, Times and Courier, which have the same widths, so text wraps as it did.

Any other font is listed after the conversion. Declare it under fonts with its files, if its licence allows embedding, or use a free font with the same metrics where there is one:

In the report Free, with the same metrics
Calibri Carlito (SIL Open Font License)
Cambria Caladea (Apache License 2.0)
Segoe UI Selawik, Microsoft’s open fallback for it (SIL Open Font License)
Arial, Times New Roman, Courier New Liberation Sans, Serif and Mono (SIL Open Font License), for PDF/A and PDF/UA, which need every font embedded
fonts:
Calibri: { regular: fonts/Carlito-Regular.ttf, bold: fonts/Carlito-Bold.ttf }

Declaring the substitute under the report’s own font name keeps every style that uses it unchanged.

The converter is also a library, Tagua.Import, for converting many reports at once:

var result = RdlcImporter.Import("Invoice.rdlc");
File.WriteAllText("Invoice.report.yaml", result.Yaml);
foreach (var issue in result.Issues) Console.WriteLine(issue);