同じレポートに 2 つのテーブルを追加し、それぞれデータベース内の異なるテーブルからのデータをバインドしたい
次のように、1 つのデータセットに 2 つのデータベース テーブルを含め、レポート内の異なるテーブルに列を割り当てようとしました。
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 ;
}
しかし、レポートで1つのテーブルに追加された各行に問題があり、空の行が他のテーブルに追加されました
私はマイクロソフトのレポートを使用しています.wpfは誰でも私を助けてくれますか?