Solved

Data bind a ReportViewer control

Posted on 2014-04-23
4
723 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

786 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