2014-09-01 65 views
0

我有东西实体CLSS:我如何显示结果列表的自我加入类在主细节?

public partial class Stuffs 
{ 
    public Stuffs() 
    { 
     this.Stuffs1 = new HashSet<Stuffs>(); 
    } 

    public long StuffID { get; set; } 
    public Nullable<long> StuffParentID { get; set; } 
    public string StuffTitle { get; set; } 


    public virtual ICollection<Stuffs> Stuffs1 { get; set; } 
    public virtual Stuffs Stuffs2 { get; set; } 
    } 

当我发送清单stimulereport,我想显示结果主 - 详细信息或父子。

这些都是我stimule代码:

public ActionResult PrintTreeStuffsResult() 
    { 
     List<Stuffs> StuffListResult = db.Stuffs.ToList(); 

     StiReport StiRpt = new StiReport(); 
     StiRpt = GetStiReportTree(StuffListResult); 
     return StiMvcViewerFx.GetReportSnapshotResult(StiRpt); 
    } 
    public StiReport GetStiReportTree(List<Stuffs> StuffsTreeResult) 
    { 
     StiReport StiRpt = new StiReport(); 
     string a = HttpContext.Server.MapPath("~/Content/Reports/Admin/StuffsTreeResult.mrt"); 
     StiRpt.Load(a); 
    StiRpt.RegBusinessObject("Stuffs", StuffsTreeResult); 

     StiRpt.Dictionary.SynchronizeBusinessObjects(); 
     StiRpt.Save(HttpContext.Server.MapPath("~/Content/Reports/Admin/StuffsTreeResult.mrt")); 
     return StiRpt; 
    } 

我上网多的样品,解释与关系约两表,forexample客户和订单中看到的。但我有一个自我加入的桌子。 我该怎么做? 谢谢...

回答

0

尝试使用下一个方法:

StiRpt.Dictionary.SynchronizeBusinessObjects(2); 
相关问题