Skip to main content

Steps to create .rdlc report in c#, asp.net

Steps to create .rdlc report in c#, asp.net

Step 1 : Create a Query and get the data from your database ..
Step 2: Add DataSet Item 
        2.1 Right click on your website and select ADD NEW ITEM option
        2.2 Select DataSet.xsd and give the name .... view below image and add one table same as your query is giving result ...
Step 3: After adding table you have to add the .rdlc report to your project 
        3.1 Right click on your website and select ADD NEW ITEM option
        3.2 Select Report.rdlc and give the name .... view below image and add one table same as your query.
        3.3 One Report page is Appear Right click on the Report page and select Insert and then Table option
 
        
   3.4 Just add fields to table 
Step 4: After that just you have to call the report by using your .aspx page ...
Step 5 :  
Create one .aspx Page 
//-------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PageName.aspx.cs"
    Inherits="Report
Page" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <rsweb:reportviewer id="RptViewer" runat="server" font-names="Verdana" font-size="8pt"
        height="800px" interactivedeviceinfos="(Collection)" waitmessagefont-names="Verdana"
        waitmessagefont-size="14pt" width="900px">
                <LocalReport ReportPath="Report\Reseller\RdlcFile\rptResellerAccountingInfo.rdlc">
                    <DataSources>
                        <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1" />
                    </DataSources>
                </LocalReport>
            </rsweb:reportviewer>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="DataSet1TableAdapters.">
    </asp:ObjectDataSource>
    </form>
</body>
</html>
using Microsoft.Reporting.WebForms;
put this code in your function to load reportViewer 
DataSet ds = new DataSet();
ds = //------------------Fill this database by your code
ReportDataSource rds = new ReportDataSource("DataSet1", ds.Tables[0]);
RptViewer.LocalReport.DataSources.Clear();
RptViewer.LocalReport.DataSources.Add(rds);
RptViewer.LocalReport.Refresh(

Comments

Popular posts from this blog

Asp.Net Web API

What is ASP.NET Web API? ASP.NET Web API is a framework provided by the Microsoft with which we can easily build HTTP services that can reach a broad of clients, including browsers, mobile, IoT devices, etc. ASP.NET Web API provides an ideal platform for building RESTful applications on the .NET Framework.   Difference between ASP.NET Web API and WCF Web AP I is a Framework to build HTTP Services that can reach a board of clients, including browsers, mobile, IoT Devices, etc. and provided an ideal platform for building RESTful applications. It is limited to HTTP based services. ASP.NET framework ships out with the .NET framework and is Open Source. WCF i.e. Windows Communication Foundation is a framework used for building Service Oriented applications (SOA) and supports multiple transport protocol like HTTP, TCP, MSMQ, etc. It supports multiple protocols like HTTP, TCP, Named Pipes, MSMQ, etc. WCF ships out with the .NET Framework. Both Web API and WCF can be self-hosted or can be...

Creating package in Oracle Database using Toad For Oracle

What are Packages in Oracle Database A package is  a group   of procedures, functions,  variables   and  SQL statements   created as a single unit. It is used to store together related objects. A package has two parts, Package  Specification  and Package Body.