Documentation

Everything you need to integrate SSRS2 into your .NET application.

1 Quick Start

Get up and running with SSRS2 in under 5 minutes.

1. Install the NuGet package

$ dotnet add package SSRS2.NETCore

2. Add the using statement

using SSRS2.Reporting.NETCore;

3. Generate your first PDF

// Load your RDLC report
using var report = new LocalReport();
report.LoadReportDefinition(File.OpenRead("Report.rdlc"));

// Add your data
report.DataSources.Add(
    new ReportDataSource("DataSetName", yourData));

// Render to PDF
var pdfBytes = report.Render("PDF");

// Save or return the PDF
File.WriteAllBytes("output.pdf", pdfBytes);

2 Installation

.NET CLI

dotnet add package SSRS2.NETCore

Package Manager Console

Install-Package SSRS2.NETCore

PackageReference (csproj)

<PackageReference Include="SSRS2.NETCore" Version="1.0.4" />

Supported frameworks: .NET 8.0, .NET 9.0, .NET 10.0, and .NET Framework 4.7.2 / 4.8 — so you can adopt SSRS2 in place, without first porting your existing Windows application.

3 Basic Usage

Loading Reports

There are multiple ways to load an RDLC report:

// From file path
report.LoadReportDefinition(File.OpenRead("path/to/report.rdlc"));

// From embedded resource
var assembly = Assembly.GetExecutingAssembly();
var stream = assembly.GetManifestResourceStream("MyApp.Reports.Report.rdlc");
report.LoadReportDefinition(stream);

// From byte array
var bytes = File.ReadAllBytes("report.rdlc");
report.LoadReportDefinition(new MemoryStream(bytes));

Adding Data Sources

// Single data source
var items = new List<Product> { ... };
report.DataSources.Add(
    new ReportDataSource("Products", items));

// Multiple data sources
report.DataSources.Add(new ReportDataSource("Orders", orders));
report.DataSources.Add(new ReportDataSource("Customers", customers));

Setting Parameters

report.SetParameters(new[] {
    new ReportParameter("ReportTitle", "Sales Report 2025"),
    new ReportParameter("ShowDetails", "true"),
    new ReportParameter("StartDate", DateTime.Now.ToString("yyyy-MM-dd"))
});

Enabling PDF Hyperlinks

// Enable hyperlinks in PDF output
report.EnableHyperlinks = true;

var pdf = report.Render("PDF");

Identical output on every platform

Report engines usually ask the operating system for the fonts a report requests. When the machine does not have one, each platform quietly substitutes something different — and the substitutes are not the same width. Segoe UI becomes Helvetica on macOS and DejaVu Sans on Linux, which is about 10% wider. Text then wraps differently, rows grow, and a table row that fits on your laptop falls off the page in your container.

SSRS2 ships metric-compatible fonts inside the package and renders from those, so the same RDLC lays out the same way on Windows, macOS, Linux and in Docker. Nothing to install on the host, and no libgdiplus.

Covered families: Arial, Helvetica, Segoe UI, Tahoma, Verdana, Trebuchet MS, Times New Roman, Georgia, Courier New, Consolas, Cambria and Calibri. Anything else falls back to the host's fonts.

Checking it at startup

If the bundled fonts cannot be found, reports still render — they just stop being reproducible across machines. Assert it once at startup rather than discovering it from a mismatched PDF.

using SSRS2.Reporting.NETCore;

// false means the font files did not reach your output directory
if (!ReportFonts.BundledFontsAvailable)
    throw new InvalidOperationException("SSRS2 fonts missing — output will vary by platform");

// Opt out and use the host's fonts instead (output becomes platform-dependent)
ReportFonts.UseSystemFonts = true;

4 Export Formats

PDF

var pdf = report.Render("PDF");
File.WriteAllBytes("report.pdf", pdf);

PNG (with custom DPI)

var deviceInfo = "<DeviceInfo><DPI>300</DPI></DeviceInfo>";

// Multi-page reports return multiple streams
var streams = new Dictionary<string, MemoryStream>();
report.Render("PNG", deviceInfo,
    (name, ext, enc, mime, seek) => {
        var stream = new MemoryStream();
        streams[name] = stream;
        return stream;
    }, out _);

foreach (var kvp in streams)
    File.WriteAllBytes($"{kvp.Key}.png", kvp.Value.ToArray());

JPEG (with quality control)

var deviceInfo = "<DeviceInfo><DPI>150</DPI><Quality>85</Quality></DeviceInfo>";

var jpeg = report.Render("JPEG", deviceInfo);

Word & Excel

// Word document
var docx = report.Render("WORDOPENXML");
File.WriteAllBytes("report.docx", docx);

// Excel spreadsheet
var xlsx = report.Render("EXCELOPENXML");
File.WriteAllBytes("report.xlsx", xlsx);
Format Name Extension MIME Type
PDF.pdfapplication/pdf
PNG.pngimage/png
JPEG.jpgimage/jpeg
WEBP.webpimage/webp
HTML5.htmltext/html
WORDOPENXML.docxapplication/vnd.openxmlformats...
EXCELOPENXML.xlsxapplication/vnd.openxmlformats...

5 Docker Deployment

SSRS2 works seamlessly in Docker containers. Here's a minimal Dockerfile:

# Build stage
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY . .
RUN dotnet publish -c Release -o /app

# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
COPY --from=build /app .

# Install fonts (optional, for better text rendering)
RUN apt-get update && apt-get install -y \
    fonts-liberation \
    && rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["dotnet", "YourApp.dll"]

Tip: For best results, install system fonts in your container. The fonts-liberation package provides good coverage for common fonts.

6 Migration from Microsoft.ReportViewer

Migrating from Microsoft.ReportViewer is straightforward. Here are the key changes. For a complete comparison of migration options (including Power BI and cost analysis), see the SSRS to .NET Core migration guide.

1. Update Namespaces

Before (Microsoft):

using Microsoft.Reporting.WinForms;
// or
using Microsoft.Reporting.WebForms;

After (SSRS2):

using SSRS2.Reporting.NETCore;

2. API Compatibility

The core API is nearly identical:

  • LocalReport class works the same way
  • Render() method signature is compatible
  • ReportDataSource and ReportParameter work identically
  • Export format strings are the same ("PDF", "EXCELOPENXML", etc.)

3. RDLC Files - No Changes Needed!

Your existing .rdlc files work as-is. No conversion or modification required.

Related Resources

Need Technical Assistance?

Our enterprise support team is here to help with implementation, migration, and troubleshooting.