Class Parameter
Represents a report parameter that is used to pass user data to a report.
Inherited Members
Namespace: FastReport.Data
Assembly: FastReport.Base.dll
Syntax
public class Parameter : Base, IFRSerializable, IParent
Remarks
See Parameters for details about using parameters.
Constructors
Parameter()
Initializes a new instance of the Parameter class with default settings.
Declaration
public Parameter()
Parameter(String)
Initializes a new instance of the Parameter class with specified name.
Declaration
public Parameter(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Properties
AsString
Gets or sets value of the parameter as a string.
Declaration
public string AsString { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DataType
Gets or sets the type of parameter.
Declaration
public Type DataType { get; set; }
Property Value
Type | Description |
---|---|
System.Type |
Description
Gets or sets the description of a parameter.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Expression
Gets or sets an expression of the parameter.
Declaration
public string Expression { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This expression will be calculated each time you access a parameter's Value.
FullName
Gets the full name of the parameter. This is useful to get the nested parameter's full name.
Declaration
public string FullName { get; }
Property Value
Type | Description |
---|---|
System.String |
Name
Gets or sets the name of parameter.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Parameters
Gets a collection of nested parameters.
Declaration
public ParameterCollection Parameters { get; }
Property Value
Type | Description |
---|---|
ParameterCollection |
Remarks
Parameters can have child (nested) parameters. To get or set a nested parameter's value, use the GetParameter(String) method.
Restrictions
This property is not relevant to this class.
Declaration
public Restrictions Restrictions { get; set; }
Property Value
Type | Description |
---|---|
Restrictions |
Value
Gets or sets the value of parameter.
Declaration
public virtual object Value { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Remarks
You may specify the static value in this property. Note: if the Expression property is not empty, it will be calculated and its value will be returned.
Methods
AddChild(Base)
Adds a child object to this object's childs.
Declaration
public void AddChild(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child | Object to add. |
Assign(Base)
Copies the contents of another, similar object.
Declaration
public override void Assign(Base source)
Parameters
Type | Name | Description |
---|---|---|
Base | source | Source object to copy the contents from. |
Overrides
Remarks
Call Assign to copy the properties from another object of the same type. The standard form of a call to Assign is
destination.Assign(source);
which tells the destination object to copy the contents of the source object to itself. In this method, all child objects are ignored. If you want to copy child objects, use the AssignAll method.
See Also
CanContain(Base)
Gets a value indicating that this object can contain the specified child object.
Declaration
public virtual bool CanContain(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child | Child object. |
Returns
Type | Description |
---|---|
System.Boolean | true if this object can contain the specified child object; otherwise, false. |
GetChildObjects(ObjectCollection)
Gets a list of child objects.
Declaration
public void GetChildObjects(ObjectCollection list)
Parameters
Type | Name | Description |
---|---|---|
ObjectCollection | list | List to fill with values. |
GetChildOrder(Base)
Returns z-order of the specified child object.
Declaration
public int GetChildOrder(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child | Child object. |
Returns
Type | Description |
---|---|
System.Int32 | Z-order of the specified object. |
Remarks
This method must return the index of a specified child object in the internal child list.
GetExpressions()
Gets all expressions contained in the object.
Declaration
public override string[] GetExpressions()
Returns
Type | Description |
---|---|
System.String[] | Array of expressions or null if object contains no expressions. |
Overrides
Remarks
Do not call this method directly. You may override it if you are developing a new component for FastReport.
This method is called by FastReport each time before run a report. FastReport do this to collect all expressions and compile them. For example, GetExpressions method of the TextObject class parses the text and returns all expressions found in the text.
RemoveChild(Base)
Removes a specified object from this object's childs.
Declaration
public void RemoveChild(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child |
Serialize(FRWriter)
Serializes the object.
Declaration
public override void Serialize(FRWriter writer)
Parameters
Type | Name | Description |
---|---|---|
FRWriter | writer | Writer object. |
Overrides
Remarks
Do not call this method directly. You should override it if you are developing a new component for FastReport.
This method is called when the object needs to save the state. It may happen when:
- saving the report to the file or stream;
- saving the report to the designer's undo buffer;
- assigning the object to another object using the Assign(Base) or AssignAll methods;
- saving the object to the designer's clipboard;
- saving the object to the preview (when run a report).
SetChildOrder(Base, Int32)
Sets the z-order of the specified object.
Declaration
public void SetChildOrder(Base child, int order)
Parameters
Type | Name | Description |
---|---|---|
Base | child | Child object. |
System.Int32 | order | New Z-order. |
Remarks
This method must place the specified child object at the specified position in the internal child list.
UpdateLayout(Single, Single)
Updates the children layout when the size of this object is changed by dx, dy values.
Declaration
public void UpdateLayout(float dx, float dy)
Parameters
Type | Name | Description |
---|---|---|
System.Single | dx | X delta. |
System.Single | dy | Y delta. |
Remarks
This method must update positions/sizes of child objects whose Dock or Anchor properties are set to non-default values.