Programming for Everybody: 📊 Professional RDLC Report Filtering with ComboBox in C# | Step-by-Step ReportViewer Tutorial

📊 Professional RDLC Report Filtering with ComboBox in C# | Step-by-Step ReportViewer Tutorial

 



code in Video:


private void Form1_Load(object sender, EventArgs e)                                                                                 

        {

            // TODO: This line of code loads data into the 'sportsDataSet.View_sport1' table. You can move, or remove it, as needed.

            this.view_sport1TableAdapter.Fillsport(this.sportsDataSet.View_sport1);

            this.comboBox1.Text = "";

            // TODO: This line of code loads data into the 'sportsDataSet.View_sport' table. You can move, or remove it, as needed.

            this.View_sportTableAdapter.Fill(this.sportsDataSet.View_sport);


            this.reportViewer1.RefreshReport();

        }


        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)

        {

            if(this.comboBox1.SelectedItem != null)

            {

                int sportvalue = int.Parse(this.comboBox1.SelectedValue.ToString());

                this.View_sportTableAdapter.searchbysport(this.sportsDataSet.View_sport, sportvalue);


                this.reportViewer1.RefreshReport();

            }

        }

No comments:

Post a Comment