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="15.1.*" />

Supported frameworks: .NET 8.0, .NET 9.0, .NET 10.0

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");

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...
CSV.csvtext/csv
XML.xmlapplication/xml

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:

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.

Need Technical Assistance?

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