Solved

Data bind a ReportViewer control

Posted on 2014-04-23
4
729 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 29

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 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