2014-09-01 48 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); 
相關問題