Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
Hi,
 
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?
 
Thanks in advance
Posted 2-Aug-12 3:10am
kubi081913

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi...
 
You need to create user control with that control, then you can define new properties.
  Permalink  
Comments
kubi081 at 2-Aug-12 8:49am
   
//SubReport control properties are set as follows:
 
public class SubReportProp
{
private DataDynamics.ActiveReports.SubReport _SubReport;
 
public SubReportProp(DataDynamics.ActiveReports.SubReport subReport, List 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 this 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
 
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 495
1 Maciej Los 340
2 Richard MacCutchan 265
3 BillWoodruff 225
4 Mathew Soji 200
0 OriginalGriff 8,804
1 Sergey Alexandrovich Kryukov 7,457
2 DamithSL 5,689
3 Maciej Los 5,279
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web02 | 2.8.1411028.1 | Last Updated 2 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100