2012-08-02 81 views
3

我們有一個使用Active Reports的報表設計器項目。 我們想使用Active Reports的SubReport工具。 子報表控件具有填充子報表的ActiveReport內容的「報表」屬性。 由於我們有一個設計器項目和一個子報表工具,我想將一個屬性添加到子報表控件中,該控件打開一個新窗體,使用戶可以從列表中選擇報表並將報表加載到子報表控件中。將新屬性添加到打開新表單的控件中?

那麼如何添加一個屬性到一個打開一個新窗口窗體的控件?

這裏是我設置的屬性:

public class SubReportProp 
{ 
    private DataDynamics.ActiveReports.SubReport _SubReport; 

    public SubReportProp(DataDynamics.ActiveReports.SubReport subReport, List<string> fieldCollection) 
    { 
     this._SubReport = subReport; 

     if (fieldCollection != null && fieldCollection.Count > 0) 
     { 
      FieldVars._DataFields = fieldCollection; 
     } 
    } 

    [DisplayName("X")] 
    [Description("Kontrolün yatay konumunu getirir veya ayarlar.")] 
    [Category("Konum")] 
    public float X 
    { 
     get 
     { 
      return SharedProp.TrimFloatValue(ActiveReport.InchToCm(_SubReport.Location.X)); 
     } 
     set 
     { 
      _SubReport.Location = new PointF(ActiveReport.CmToInch(value), _SubReport.Location.Y); 
     } 
    } 

    [DisplayName("Y")] 
    [Description("Kontrolün dikey konumunu getirir veya ayarlar.")] 
    [Category("Konum")] 
    public float Y 
    { 
     get 
     { 
      return SharedProp.TrimFloatValue(ActiveReport.InchToCm(_SubReport.Location.Y)); 
     } 
     set 
     { 
      _SubReport.Location = new PointF(_SubReport.Location.X, ActiveReport.CmToInch(value)); 
     } 
    } 
} 

像這些x,y座標我還需要添加另一個屬性,它使用戶能夠從列表中選擇一個報告,並適用於_SubReport.Report

+0

請給我看SubReport控制的代碼 – HatSoft 2012-08-02 12:23:16

回答

2

http://blogs.gcpowertools.co.in/2011/11/showcase-enhance-end-user-designer.html#more

我想你應該看看這個博客。它確實是你想要的。

+0

這正是我要找的,但是示例項目鏈接已經死了!我真的需要看到這個示例項目。感謝您的回覆 – 2012-08-03 06:34:21

+0

您可以從這裏下載示例:http://speedy.sh/56sMq/Enhanced-EndUserDesigner.zip – 2012-08-03 06:43:14

+0

非常感謝, – 2012-08-03 07:06:11

1

kubilay

報告佈局可以保存到流中。您可以將它作爲blob/byte數組保存到數據庫中。如果可能的話,您還可以將文檔以xml格式保存爲文本。這是使用ActiveReport的SaveLayout API完成的。

然後,可以使用LoadLayout API來加載此報告。

相關問題