我想在同一个报告中添加两个表,每个表绑定来自数据库中不同表的数据
我试图使一个数据集包含两个数据库表,并将列分配给报告中的不同表,如下所示:
rptViewer.LocalReport.DataSources.Clear();
rptViewer.LocalReport.DataSources.Add(new ReportDataSource("reportDS", getData())); //reportDS the dataset cretated with report
rptViewer.LocalReport.ReportPath = @"../../portifolioReport.rdlc";
rptViewer.RefreshReport();
private DataTable getData()
{
SqlCeCommand cmd = new SqlCeCommand("select * from portifolio where patient_NID='"+NIDTxtBox4.Text+"'", con);
SqlCeCommand cmd2 = new SqlCeCommand("select * from patients where NID='"+NIDTxtBox4.Text+"'", con);
DataSet1.DataTable1DataTable dt = new DataSet1.DataTable1DataTable();
SqlCeDataAdapter dscmd = new SqlCeDataAdapter(cmd);
SqlCeDataAdapter dscmd2 = new SqlCeDataAdapter(cmd2);
dscmd.Fill(dt);
dscmd2.Fill(dt);
return dt ;
}
但是在报告的一个表中添加的每一行都有问题,在另一个表中添加了空行
我正在使用微软报告,wpf 有人可以帮助我吗?