【发布时间】:2010-05-26 07:31:22
【问题描述】:
我想在我的 c# windows 应用程序中制作一个水晶报表,重点是我想使用 .net 对象作为我的报表数据源,我在互联网上找到了如下示例代码并使用它们,它工作正常:
ArrayList Mainlst = new ArrayList();
Mainlst.Add(new testOBJ { Firstname = "test1", Lastname = "test11" });
Mainlst.Add(new testOBJ { Firstname = "test2", Lastname = "test21" });
Mainlst.Add(new testOBJ { Firstname = "test3", Lastname = "test31" });
Mainlst.Add(new testOBJ { Firstname = "test4", Lastname = "test41" });
Mainlst.Add(new testOBJ { Firstname = "test5", Lastname = "test51" });
testCrystalReport rpt = new testCrystalReport ();
rpt.SetDataSource(Mainlst);
crystalReportViewer1.ReportSource = rpt;
但是我想为这些重复的信息发送额外的对象,例如学校信息,但我无法发送这个额外的对象,有什么解决方案可以将多个对象发送到水晶报告?当然我知道我可以使用多个数据表和数据集作为水晶报表数据源,但在这里我只想使用对象和 IEnumerables 作为水晶报表的数据源。
【问题讨论】:
标签: c# .net crystal-reports