Hey satabeach,
Please refer below sample.
For creating RDLC report refer below article link.
HTML
<div>
<asp:ScriptManager ID="Scriptmanager1" runat="server">
</asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server">
</rsweb:ReportViewer>
</div>
Namespaces
C#
using System.Data;
using Microsoft.Reporting.WebForms;
VB.Net
Imports System.Data
Imports Microsoft.Reporting.WebForms
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Report.rdlc");
DataTable dt = GetData();
ReportDataSource datasource = new ReportDataSource("Customers", dt);
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(datasource);
}
}
private DataTable GetData()
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[] { new DataColumn("CustomerID", typeof(int)), new DataColumn("Name", typeof(string)), new DataColumn("UniCodeChar", typeof(string)) });
dt.Rows.Add(1, "Mudassar Ahmed Khan", System.Convert.ToChar(System.Convert.ToUInt32("2605", 16)));
dt.Rows.Add(2, "John Hammond", System.Convert.ToChar(System.Convert.ToUInt32("2602", 16)));
dt.Rows.Add(3, "Suzanne Mathews", System.Convert.ToChar(System.Convert.ToUInt32("260E", 16)));
dt.Rows.Add(4, "Robert Schidner", System.Convert.ToChar(System.Convert.ToUInt32("2615", 16)));
return dt;
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not IsPostBack Then
ReportViewer1.ProcessingMode = ProcessingMode.Local
ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Report.rdlc")
Dim dt As DataTable = GetData()
Dim datasource As ReportDataSource = New ReportDataSource("Customers", dt)
ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.LocalReport.DataSources.Add(datasource)
End If
End Sub
Private Function GetData() As DataTable
Dim dt As DataTable = New DataTable()
dt.Columns.AddRange(New DataColumn() {New DataColumn("CustomerID", GetType(Integer)), New DataColumn("Name", GetType(String)), New DataColumn("UniCodeChar", GetType(String))})
dt.Rows.Add(1, "Mudassar Ahmed Khan", System.Convert.ToChar(System.Convert.ToUInt32("2605", 16)))
dt.Rows.Add(2, "John Hammond", System.Convert.ToChar(System.Convert.ToUInt32("2602", 16)))
dt.Rows.Add(3, "Suzanne Mathews", System.Convert.ToChar(System.Convert.ToUInt32("260E", 16)))
dt.Rows.Add(4, "Robert Schidner", System.Convert.ToChar(System.Convert.ToUInt32("2615", 16)))
Return dt
End Function
Screenshot