Microsoft Report Viewer May 2026
What is Microsoft Report Viewer?
Microsoft Report Viewer is a Windows Forms control that allows developers to display reports in their .NET applications. It is part of the Microsoft Reporting Services and can be used to display reports created using Reporting Services, Report Builder, or other reporting tools.
Key Features of Microsoft Report Viewer
- Report Display: The control displays reports in a variety of formats, including HTML, PDF, Excel, Word, and CSV.
- Report Navigation: Users can navigate through reports using the control's built-in navigation tools, such as drill-down, drill-up, and hyperlink support.
- Interactive Features: The control supports interactive features, such as sorting, filtering, and parameter prompting.
- Data Binding: The control can be bound to a variety of data sources, including SQL Server, Oracle, and OLE DB.
- Customization: The control can be customized to suit the needs of the application, including changing the layout, fonts, and colors.
How to Use Microsoft Report Viewer
- Add the Control to a Form: Add the Report Viewer control to a Windows Forms application.
- Set the Report Source: Set the report source to a report file (.rdlc) or a Reporting Services report server.
- Configure the Control: Configure the control's properties, such as the report viewer layout and interactive features.
- Run the Application: Run the application and display the report.
Benefits of Using Microsoft Report Viewer
- Easy to Use: The control is easy to use and integrate into .NET applications.
- Flexible: The control supports a variety of report formats and data sources.
- Customizable: The control can be customized to suit the needs of the application.
Common Use Cases for Microsoft Report Viewer
- Displaying Reports in a Windows Forms Application: Use the Report Viewer control to display reports in a Windows Forms application.
- Integrating Reporting Services Reports: Use the control to integrate Reporting Services reports into a .NET application.
- Creating a Custom Reporting Solution: Use the control to create a custom reporting solution for a .NET application.
Code Example
Here is an example of how to use the Report Viewer control in a Windows Forms application:
using System;
using System.Windows.Forms;
using Microsoft.Reporting.WinForms;
namespace ReportViewerExample
public partial class Form1 : Form
public Form1()
InitializeComponent();
private void Form1_Load(object sender, EventArgs e)
// Create a new report viewer
ReportViewer reportViewer = new ReportViewer();
// Set the report source
reportViewer.LocalReport.ReportEmbeddedResource = "Report1.rdlc";
// Add the report viewer to the form
this.Controls.Add(reportViewer);
// Refresh the report
reportViewer.RefreshReport();
This example creates a new Report Viewer control, sets the report source to a report file (.rdlc), and adds the control to a Windows Forms application.
2.1 Local Processing Mode (RDLC)
In Local Mode, the Report Viewer control performs the rendering engine's work entirely on the client machine (the application server or user desktop). microsoft report viewer
- File Format: Uses RDLC (Report Definition Language Client) files. These are XML files defining the layout, similar to RDL but with no embedded data connection strings.
- Data Handling: The application is responsible for retrieving data (ADO.NET DataSets, Entity Framework collections, Business Objects) and pushing it into the control.
- Dependencies: Does not require a SQL Server Reporting Services server license.
- Use Case: Ideal for distributed applications where the database connection is abstracted by the application logic or when offline reporting is required.
Issue: "The definition of the report is invalid"
This is the most common error. It usually means the name of the Data Source in your code ("DataSet1") does not match the name of the Data Source inside the RDLC file.
- Fix: Open the RDLC file, look at the "Report Data" pane, and ensure the name of the dataset matches the string passed to
new ReportDataSource().
Microsoft Report Viewer: The Complete Guide to Local Reporting in .NET
Step 3: Add the Control to the Form
- Open your Form (e.g.,
Form1.cs). - Open the Toolbox. You may need to right-click the Toolbox and select "Choose Items" to locate the
ReportViewercontrol if it doesn't appear automatically. - Drag the
ReportVieweronto the form.
A. Local Processing Mode (Client-side Reporting)
In Local Mode, the Report Viewer control does all the work. The application supplies the data (typically as a DataTable, List, or IEnumerable), and the control renders the report using its local engine.
- Data Source: Provided by the host application code.
- Dependencies: Requires the Report Viewer runtime redistributable installed with the app.
- Use Case: Ideal for desktop applications (WinForms/WPF) or web apps where the database logic is handled by the application code, not a dedicated report server.
The Modern Standard: Microsoft.ReportingServices.ReportViewerControl
This is the modern, redesigned control built to support newer web standards and integration. What is Microsoft Report Viewer
- NuGet: Available via
Microsoft.ReportingServices.ReportViewerControl.WebFormsorWinForms. - Platform: Primarily focused on the .NET Framework but offers better HTML5 rendering support compared to the legacy versions.
Step 2: Create the Report Definition (.RDLC)
- Add a new item to your project: Report (often named
Report1.rdlc). - This will open the Report Designer.
- Define a Data Source (e.g., a Database or an Object Data Source pointing to a C# class).
- Drag a Table or Chart onto the design surface and map the fields from your Data Source.