Solved

Data bind a ReportViewer control

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now