C# Crystal reports数据源及其引用
我刚接触crystal reports,有一个问题。我需要子报表或表中的分组,但问题是我有两个类别Group和Foo,Group有List,我需要通过Group.Name和显示来自Foo的数据进行分组 例如:C# Crystal reports数据源及其引用,c#,crystal-reports,reporting,objectdatasource,crystal-reports-2010,C#,Crystal Reports,Reporting,Objectdatasource,Crystal Reports 2010,我刚接触crystal reports,有一个问题。我需要子报表或表中的分组,但问题是我有两个类别Group和Foo,Group有List,我需要通过Group.Name和显示来自Foo的数据进行分组 例如: public class Group { public string Name{get;set;} public List<Group> Children{get;set} public Group ParentG
public class Group
{
public string Name{get;set;}
public List<Group> Children{get;set}
public Group ParentGroup{get;set;}
public List<Foo> Items{get;set;}
}
public class Foo
{
public string Name{get;set;}
public string Number{get;set;}
public double Price{get;set;}
public double Quantity{get;set;}
}
公共类组
{
公共字符串名称{get;set;}
公共列表子项{get;set}
公共组父组{get;set;}
公共列表项{get;set;}
}
公开课Foo
{
公共字符串名称{get;set;}
公共字符串编号{get;set;}
公共双价{get;set;}
公共双数量{get;set;}
}
我希望得到按组分组的报告。名称并查看Foo详细信息
例如:
public class Group
{
public string Name{get;set;}
public List<Group> Children{get;set}
public Group ParentGroup{get;set;}
public List<Foo> Items{get;set;}
}
public class Foo
{
public string Name{get;set;}
public string Number{get;set;}
public double Price{get;set;}
public double Quantity{get;set;}
}
第一组
|名称|编号|数量|价格|总价|
|钢笔| 01 | 3 | 15 | 45| |橡皮擦| 14 | 1 | 20 | 20| 最好的方法是什么?数据不在数据库中,它在c#中仅作为对象。但真正的问题是参考组 谢谢你的帮助。Jakub解决方案: 在单个SP中从数据库中拉出两个数据表
数据不在数据库中,它在c#应用程序中的对象中。我想我可以做一些像添加GroupID和在Group和Foo之间连接的事情,但这是一个可怕的解决方案。然后使用Ienumerable集合来实现同样的效果。看这个,这不是问题。问题是在数据库中,它将是ID为的表Group和ID为Group_的表FOO。然后我可以在子报表中使用类似GroupID的参数,并使用linq Where(q=>ParamGroupID==Group_ID)。但我没有组ID,我有从类组到IEnumerable项的引用。问题是:如何将子报表引用的数据源从类组添加到此项,而不使用类似于内部linq查询的内容。我看不到字段ExplorerMaybe中的项。如果有办法,如何为每个分组的部分设置子报表数据源。但是我找不到该怎么做