[英]Rdlc Reporting C#.net
在.rdlc
报告中需要帮助。
我有一个.RDLC
报告,类似于附件。
在这里,我可以为每个学生每次打印一张身份证。 我可以根据学生唯一的无当前会话收集所需的数据,并将其传递给rdlc报告以进行打印。
现在的问题是,如果我想为所有学生打印/生成ID卡,而不是每次都打印一张入场卡,我现在该怎么办? 我可以获得所有学生的数据,但我不知道如何在报告中表示这些数据以实现此目标。
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();
}
任何帮助将不胜感激; 我已经花了几个小时在谷歌上搜索,但一点都没有头绪
在报告正文中创建一个列表,然后在该列表中设计身份证。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.