Solved

Data bind a ReportViewer control

Posted on 2014-04-23
4
726 Views
Last Modified: 2014-04-30
Hi, I'm trying to learn on the fly, I've added a report viewer control to an aspx page and have a DataAdpater.  How would I bind the report view control to my dataadapter?

<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="lblPein" runat="server" Text="Pein"></asp:Label><asp:TextBox ID="txtPein" runat="server"></asp:TextBox>
        <br />
        <asp:Label ID="lblMTH" runat="server" Text="MTH"></asp:Label><asp:TextBox ID="txtMTH" runat="server"></asp:TextBox>
        <br />
        <asp:Button ID="btnSubmit" runat="server" Text="Submit" />
               
        <asp:ScriptManager ID="ScriptManager1" runat="server">
             </asp:ScriptManager>
            <rsweb:ReportViewer ID="ReportViewer1" runat="server"></rsweb:ReportViewer>
        <br />
    </div>
    </form>
</body>


protected void Page_Load(object sender, EventArgs e)
        {
            String eceoConn = ConfigurationManager.ConnectionStrings["CalcMTHISS"].ConnectionString;

            using (SqlConnection CalcMTHISS = new SqlConnection(eceoConn))
            {
                SqlCommand cmdCalcMTHISS = new SqlCommand("CalcMTHISS_query", CalcMTHISS);
                cmdCalcMTHISS.CommandType = System.Data.CommandType.StoredProcedure;
                cmdCalcMTHISS.Parameters.AddWithValue("@cr_pein", txtPein);
                cmdCalcMTHISS.Parameters.AddWithValue("@MTH", txtMTH);

                SqlDataAdapter daCalcMTHISS = new SqlDataAdapter(cmdCalcMTHISS);
                DataSet dsCalcMTHISS = new DataSet();
               
               

            }
        }
0
Comment
Question by:Scarlett72
  • 2
4 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 40019941
Which report viewer control?

mlmcc
0
 

Author Comment

by:Scarlett72
ID: 40020024
Hi mlmcc, there is a report control called a ReportViewer in the reporting section of the Visual Studio toolbox.  It creates an .rdlc file where a report can be created using reporting services report designer.  I'm trying to understand how to run it in localmode and bind it to a datasource.  I'm not finding a lot of clear information on this.  Any help would be appreciated.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40020340
I don't know how to bind that one.  I work with other report viewer controls that are available with VS.

mlmcc
0
 
LVL 28

Accepted Solution

by:
sammySeltzer earned 500 total points
ID: 40020514
What exactly are you trying to do?

First, you create the dataset (dataApter) which you have done.

Next, you build your report, .rdlc. Again, it seems like you have done this part.

Finally, create a .aspx page with your report embedded.

You would do this by going to the design tab of your .aspx, drag and drop the reportviewer onto your .aspx page.

Then drag and drop scriptmanager control.

Save and run.

Are you having any specific issue?
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question