articles

Home / DeveloperSection / Articles / MicrosoftReportViewer Control in ASP.Net

MicrosoftReportViewer Control in ASP.Net

John Smith9593 03-Dec-2010

MicrosoftReportViewer control is used to generate report.

Steps to generate report using MicrosoftReportViewer 

Drag and Drop MicrosoftReportViewer

MicrosoftReportViewer Control in ASP.Net

Drag and Drop ObjectDataSource

MicrosoftReportViewer Control in ASP.Net

Now click on the Design a new report task which open Report Wizard window as shown in the figure.

MicrosoftReportViewer Control in ASP.Net

Click Next

MicrosoftReportViewer Control in ASP.Net

Click new connection

MicrosoftReportViewer Control in ASP.Net

 

MicrosoftReportViewer Control in ASP.Net

Select your server name, select Sql Server Authentication and enter username & password  and select your database name then click OK

MicrosoftReportViewer Control in ASP.Net

Click next

MicrosoftReportViewer Control in ASP.Net

Click yes

MicrosoftReportViewer Control in ASP.Net

Click Next

MicrosoftReportViewer Control in ASP.Net

Click Finish

MicrosoftReportViewer Control in ASP.Net

Click Next

MicrosoftReportViewer Control in ASP.Net

Click Next

MicrosoftReportViewer Control in ASP.Net

Click details until available fields not null

MicrosoftReportViewer Control in ASP.Net

Click Next

MicrosoftReportViewer Control in ASP.Net

Click Next

MicrosoftReportViewer Control in ASP.Net

Click Next

MicrosoftReportViewer Control in ASP.Net

Click Finish

MicrosoftReportViewer Control in ASP.Net

MicrosoftReportViewer Control in ASP.Net

Click Configure Data Source

 

MicrosoftReportViewer Control in ASP.Net

 

MicrosoftReportViewer Control in ASP.Net

Click Next

 

MicrosoftReportViewer Control in ASP.Net

Click Finish

MicrosoftReportViewer Control in ASP.Net

    

Now choose report from ReportViewer Tasks

MicrosoftReportViewer Control in ASP.Net

Now execute

MicrosoftReportViewer Control in ASP.Net

Generated Code:

    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
        Font-Size="8pt" Height="400px" Width="400px">
        <LocalReport ReportPath="Report1.rdlc">
            <DataSources>
                <rsweb:ReportDataSource DataSourceId="ObjectDataSource1"
                    Name="myDataSet_insert_reg" />
            </DataSources>
        </LocalReport>
    </rsweb:ReportViewer>
   
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
        TypeName="myDataSetTableAdapters.insert_regTableAdapter">
    </asp:ObjectDataSource>

 

MicrosoftReportViewer Control in ASP.Net


Updated 04-Mar-2020
I am best.

Leave Comment

Comments

Liked By