我在vs2010中做了一个水晶报表,想要调用2个表中的数据,其中一个表是入库单的信息例如:入库时间等
另一个表是入库商品的详细信息例如:货物名称等等。一个入库单对应多个入库商品。
我能将一个表的信息在水晶报表中显示出来,但是另一个表的信息不知道怎么能弄出来
下面是我的代码c#
SqlConnection con = new SqlConnection(conStr);
con.Open();
string sql = string.Format("select * from RuKu ");
SqlDataAdapter ad = new SqlDataAdapter(sql, con);
DataSet1 dt1 = new DataSet1();
ad.Fill(dt1, "mytable");
ReportDocument myreport = new ReportDocument();
string P_str_creportPath = Application.StartupPath.Substring(//得到报表路径信息
0, Application.StartupPath.Substring(0,
Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\"));
P_str_creportPath += "\\MyCrystalReport.rpt";//添加报表名称
myreport.Load(P_str_creportPath);//加载报表
//myreport.Load(Application.StartupPath + "MyCrystalReport.rpt");
myreport.SetDataSource(dt1);
crystalReportViewer1.ReportSource = myreport;
con.Close();
我这里想请教各位高人几个问题:
1.如何把2个表的信息都能在报表上显示出来
2.怎能令报表能弄成类似下图的效果

还请大家帮帮忙,小弟不胜感谢