FlexReport for WinForms
Evaluate(String) メソッド
使用例 


C1.Report.4.6.2 アセンブリ > C1.Report 名前空間 > FlexReport クラス > Evaluate メソッド : Evaluate(String) メソッド
A string with a VBScript expression to be evaluated.
Evaluates a VBScript expression in the current report context.
シンタックス
'宣言
 
Public Overloads Function Evaluate( _
   ByVal expression As System.String _
) As System.Object
'使用法
 
Dim instance As FlexReport
Dim expression As System.String
Dim value As System.Object
 
value = instance.Evaluate(expression)
public System.object Evaluate( 
   System.string expression
)

パラメータ

expression
A string with a VBScript expression to be evaluated.

戻り値の型

The value of the expression.
解説

Use this method to evaluate expressions as they would be evaluated while generating a report. This can be useful in designer-type applications, to provide an "Immediate Window" where users can test expressions.

If the expression string contains invalid syntax or causes an evaluation error, the control raises the ReportError event. In this case, the Handled parameter of the event is set to true, so the exception is ignored by default.

使用例

Expressions may contain simple VBScript expressions such as:

Expressions may also contain references to the Report object and all its sub-objects. For example:

Finally, data fields, Field, and Section objects may be referenced directly by name.

Console.WriteLine(_c1r.Evaluate("2+2"));
  4
Console.WriteLine(_c1r.Evaluate(" \"A\" & \"B\" ");
  AB
Console.WriteLine(_c1r.Evaluate("Report.DataSource.RecordSource"));
  SELECT * FROM Employees
Console.WriteLine(_c1r.Evaluate("Report.DataSource.Recordset.Fields.Count"));
  7
Console.WriteLine(_c1r.Evaluate("Report.Fields(0).Name"));
  FirstNameField
Console.WriteLine(_c1r.Evaluate("FirstNameField.Value"));
  Andrew
Console.WriteLine(_c1r.Evaluate("CategoryName"));
  Beverages
参照

参照

FlexReport クラス
FlexReport メンバ
オーバーロード一覧