In this article I will explain with an example, how to export RDLC Report to Excel without using ReportViewer in ASP.Net with C# and VB.Net.
Here I am making use of Microsoft’s Northwind Database. You can download it from here.
HTML Markup
The HTML Markup consists of a RDLC ReportViewer control, a RadioButtonList with the Export file formats and a Button to export RDLC Reports to Word, Excel, PDF and Image file formats.
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="500" SizeToReportContent = "true">
    <br />
    <asp:RadioButtonList ID="rbFormat" runat="server" RepeatDirection="Horizontal">
        <asp:ListItem Text="Word" Value="WORD" Selected="True" />
        <asp:ListItem Text="Excel" Value="EXCEL" />
        <asp:ListItem Text="PDF" Value="PDF" />
        <asp:ListItem Text="Image" Value="IMAGE" />
    <br />
    <asp:Button ID="btnExport" Text="Export" runat="server" OnClick="Export" />
You will need to import the following namespaces.
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
using Microsoft.Reporting.WebForms;
Imports System.Data
Imports System.Configuration
Imports System.Data.SqlClient
Imports Microsoft.Reporting.WebForms
Designing and populating the RDLC Report from Database
Inside the Page Load event, the RDLC Report is populated from database.
Note: For more details about designing and populating RDLC Report, please refer the following article.
         RDLC (Local SSRS) Report ASP.Net Example
protected void Page_Load(object sender, EventArgs e)
    if (!this.IsPostBack)
        ReportViewer1.ProcessingMode = ProcessingMode.Local;
        ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Report.rdlc");
        Customers dsCustomers = GetData("SELECT TOP 10 * FROM Customers");
        ReportDataSource datasource = new ReportDataSource("Customers", dsCustomers.Tables[0]);
private Customers GetData(string query)
    string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
    SqlCommand cmd = new SqlCommand(query);
    using (SqlConnection con = new SqlConnection(conString))
        using (SqlDataAdapter sda = new SqlDataAdapter())
            cmd.Connection = con;
            sda.SelectCommand = cmd;
            using (Customers dsCustomers = new Customers())
                sda.Fill(dsCustomers, "DataTable1");
                return dsCustomers;
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
    If Not Me.IsPostBack Then
        ReportViewer1.ProcessingMode = ProcessingMode.Local
        ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Report.rdlc")
        Dim dsCustomers As Customers = GetData("SELECT TOP 10 * FROM Customers")
        Dim datasource As New ReportDataSource("Customers", dsCustomers.Tables(0))
    End If
End Sub
Private Function GetData(query As String) As Customers
    Dim conString As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
    Dim cmd As New SqlCommand(query)
    Using con As New SqlConnection(conString)
        Using sda As New SqlDataAdapter()
            cmd.Connection = con
            sda.SelectCommand = cmd
            Using dsCustomers As New Customers()
                sda.Fill(dsCustomers, "DataTable1")
                Return dsCustomers
            End Using
        End Using
    End Using
End Function
Exporting RDLC Report to Excel without using ReportViewer in ASP.Net
When the Export Button is clicked, the selected value of the RadioButtonList is passed to the Render method of RDLC ReportViewer.
The Render method returns the exported document in Byte Array format.
Finally, the Byte Array is written to Response Stream and downloaded as Attachment in Word, Excel, PDF or Image files.
protected void Export(object sender, EventArgs e)
    Warning[] warnings;
    string[] streamIds;
    string contentType;
    string encoding;
    string extension;
    //Export the RDLC Report to Byte Array.
    byte[] bytes = ReportViewer1.LocalReport.Render(rbFormat.SelectedItem.Value, null, out contentType, out encoding, out extension, out streamIds, out warnings);
    //Download the RDLC Report in Word, Excel, PDF and Image formats.
    Response.Buffer = true;
    Response.Charset = "";
    Response.ContentType = contentType;
    Response.AppendHeader("Content-Disposition", "attachment; filename=RDLC." + extension);
Protected Sub Export(ByVal sender As Object, ByVal e As EventArgs)
    Dim warnings As Warning()
    Dim streamIds As String()
    Dim contentType As String
    Dim encoding As String
    Dim extension As String
    'Export the RDLC Report to Byte Array.
    Dim bytes As Byte() = ReportViewer1.LocalReport.Render(rbFormat.SelectedItem.Value, Nothing, contentType, encoding, extension, streamIds, warnings)
    'Download the RDLC Report in Word, Excel, PDF and Image formats.
    Response.Buffer = True
    Response.Charset = ""
    Response.ContentType = contentType
    Response.AppendHeader("Content-Disposition", "attachment; filename=RDLC." & extension)
End Sub
The RDLC Report
Export RDLC Report to Excel without using ReportViewer in ASP.Net with C# and VB.Net
RDLC Report exported to Excel Spreadsheet
Export RDLC Report to Excel without using ReportViewer in ASP.Net with C# and VB.Net