cristy Ruds
cristy Ruds

Reputation: 3

Rdlc Reporting C#.net

Need help with in .rdlc reporting.

I have a .RDLC report like the one attached.

Here I can print one idcard each time for each student. I can collect the required data based on a student's unique no current session and pass that to the rdlc report to print that.

Now the problem is if I want to print/generate the Id cards for all students instead of printing one admit card each time what should I can do now? I can get all student's data but I have no idea how to represent them in report to achieve this goal.

My rdlc report format

private void btnsearch_Click(object sender, EventArgs e)
        {

                if (txtcardid.Text == "")
                {
                    txtcardid.Focus();
                    return;
                }
                else if (txtcardid.Text != "")
                {

                    string sel = "select *  from tbl_student where Card_id='" + txtcardid.Text + "' ";
                    DataTable datTab = mod.filldatatbl(sel);
                    if (datTab.Rows.Count.ToString() == "0")
                    {
                        label2.ForeColor = Color.Red;
                        label2.Text = "No Records Found";
                        SqlDataAdapter sda = new SqlDataAdapter();
                        BindingSource bds = new BindingSource();
                        bds.DataSource = datTab;

                        sda.Update(datTab);
                        this.tbl_studentBindingSource.DataSource = bds;
                        this.reportViewer1.RefreshReport();
                        btnsearch.Text = datTab.Rows.Count.ToString();
                    }
                    else if (datTab.Rows.Count.ToString() != "0")
                    {
                        //string sel1 = "select distinct Card_id,StudentName,RollNo,class,ContactNo,section,dates,totalhour,status1,  min(Intime) as Intime, max(Outtime) as Outtime  from tbl_stuAtten where Card_id='" + textBox1.Text + "' and dates between '" + dateTimePicker1.Text + "' and '" + dateTimePicker2.Text + "' group by Card_id,StudentName,RollNo,class,ContactNo,section,dates,totalhour,status1";
                        //DataTable datTab1 = mod.filldatatbl(sel1);
                        string cnt;
                        cnt = datTab.Rows.Count.ToString();
                        label2.ForeColor = Color.Green;
                        label2.Text = "" + cnt + " : Records Found ";
                        SqlDataAdapter sda = new SqlDataAdapter();
                        BindingSource bds = new BindingSource();
                        bds.DataSource = datTab;

                        sda.Update(datTab);

                        btnsearch.Text = datTab.Rows.Count.ToString();
                        this.tbl_studentBindingSource.DataSource = bds;
                        this.reportViewer1.RefreshReport();
                    }
                }


            //this.reportViewer1.RefreshReport();
        }

Any kind of help will be appreciated; I have spent hours googling it but no clue at all

Upvotes: 0

Views: 879

Answers (1)

Nam Bình
Nam Bình

Reputation: 422

Create a list in your report body then design the id card inside that list.

Upvotes: 1

Related Questions