We have a report designer project which uses Active Reports. We want to use SubReport tool of the Active Reports. Subreport control has a "report" property which fills the ActiveReport content of the Subreport. Since we have a designer project and a SubReport tool, I want to add a property to the SubReport control which opens a new form that enables user to choose a report from the list and load report into the SubReport control.
So how can I add a property to a control which opens a new windows form?
Here is how I set the properties:
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));
}
}
}
Like these x, y coordinates I also need to add another property which enables user to choose a report from a list and apply to _SubReport.Report