Class Evaluator
Evaluator is an expression evaluator, it includes variable assignment and support for dataset fields, function calls are also supported
Inherited Members
Namespace: Reportman.Reporting
Assembly: Reportman.Reporting.dll
Syntax
public class Evaluator : Component, IComponent, IDisposable
Constructors
Evaluator()
Declaration
public Evaluator()
Evaluator(IContainer)
Declaration
public Evaluator(IContainer container)
Parameters
| Type | Name | Description |
|---|---|---|
| IContainer | container |
Fields
Language
Language property is used in funtions returning localized strings
Declaration
public int Language
Field Value
| Type | Description |
|---|---|
| int |
Properties
AliasList
AliasList is used to provide access to dataset fields to the Evaluator
Declaration
public DatasetAlias AliasList { get; set; }
Property Value
| Type | Description |
|---|---|
| DatasetAlias |
Expression
Declaration
public string Expression { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Identifiers
Declaration
public EvalIdentifiers Identifiers { get; }
Property Value
| Type | Description |
|---|---|
| EvalIdentifiers |
Result
This property contains the last result of the evaluation of an expression
Declaration
public Variant Result { get; }
Property Value
| Type | Description |
|---|---|
| Variant |
Methods
AddIden(string, EvalIdentifier)
Addd any identifier object to the evaluator
Declaration
public void AddIden(string name1, EvalIdentifier iden)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name1 | Identifier name |
| EvalIdentifier | iden | Identifier object |
AddVariable(string, EvalIdentifier)
Add a variable to the evaluator
Declaration
public void AddVariable(string name1, EvalIdentifier iden)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name1 | Variable name |
| EvalIdentifier | iden | Identifier object, usually a IdenVariable typed object |
CheckSyntax(string)
Provide syntax checking utility
Declaration
public void CheckSyntax(string atext)
Parameters
| Type | Name | Description |
|---|---|---|
| string | atext |
Dispose(bool)
Cleanup resources
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
Overrides
Evaluate()
Declaration
public Variant Evaluate()
Returns
| Type | Description |
|---|---|
| Variant |
EvaluateText(string)
Declaration
public Variant EvaluateText(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text |
Returns
| Type | Description |
|---|---|
| Variant |
GetStreamFromExpression(string)
Obtains a memory stream from an expression resulting in a file name path or a database field
Declaration
public MemoryStream GetStreamFromExpression(string expre)
Parameters
| Type | Name | Description |
|---|---|---|
| string | expre | Expression to evaluate |
Returns
| Type | Description |
|---|---|
| MemoryStream | A Memory stream or null if the result is not a stream |
NewVariable(string, Variant)
Create a new variable with an initial value
Declaration
public IdenVariable NewVariable(string name1, Variant valueIni)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name1 | Variable name |
| Variant | valueIni | Initial value |
Returns
| Type | Description |
|---|---|
| IdenVariable |
SearchIdentifier(string)
Looks for an identifier, returns null if not found
Declaration
public EvalIdentifier SearchIdentifier(string idenname)
Parameters
| Type | Name | Description |
|---|---|---|
| string | idenname | Identifier name |
Returns
| Type | Description |
|---|---|
| EvalIdentifier | Identifier found or null |
Events
OnDatasetNeeded
Declaration
public event DataNeededEvent OnDatasetNeeded
Event Type
| Type | Description |
|---|---|
| DataNeededEvent |