Solved

Data bind a ReportViewer control

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Hi, I have heard from my friends that it’s not possible to create Label Printing report using SSRS. I am amazed after hearing this words not possible in SSRS. I googled lot and found that it is possible to some of people know about the Report Bui…
Introduction Earlier I wrote an article about the new lookup functions (http://www.experts-exchange.com/A_3433.html) that ship with SQL Server 2008 R2.  In this article I’m going to show you another new feature of SSRS 2008 R2, this time in the vis…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 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

22 Experts available now in Live!

Get 1:1 Help Now