12.8. The OpenCReport\Expr class #

12.8.1. Free an expression
12.8.2. Get the original expression string
12.8.3. Print an expression
12.8.4. Get the number of expression tree nodes
12.8.5. Resolve an expression
12.8.6. Optimize an expression
12.8.7. Evaluate an expression
12.8.8. Get the result of an expression
12.8.9. Set expression result to a string value
12.8.10. Set expression result to a long value
12.8.11. Set expression result to a double value
12.8.12. Set expression result to a numeric value from string
12.8.13. Get number of operands of a expression
12.8.14. Get nth operands' result of a expression
12.8.15. Compare the expression's current and previous results
12.8.16. Initialize expression results
12.8.17. Get string value of an expression
12.8.18. Get long value of an expression
12.8.19. Get double value of an expression
12.8.20. Get numeric value of an expression as a string
12.8.21. Set nth result of an expression to a string value
12.8.22. Set nth result of an expression to a long value
12.8.23. Set nth result of an expression to a double value
12.8.24. Set iterative start flag of an expression
12.8.25. Set expression to delayed

class OpenCReport\Expr {
    public final free(): void;

    public final get_expr_string(): string;

    public final print(): void;

    public final nodes(): long;

    public final resolve(): void;
    public final optimize(): void;
    public final eval():
                     ?OpenCReport\Result;

    public final get_result():
                     ?OpenCReport\Result;
    public final set_string(
                     string $value): void;
    public final set_long(
                     long $value): void;
    public final set_double(
                     double $value): void;
    public final set_number(
                     string $value): void;

    public final get_num_operands(): long;

    public final operand_get_result(
                     long $opidx):
                     ?OpenCReport\Result;

    public final cmp_results(): bool;

    public final init_results(long $result_type):
                     void;
    public final get_string(): ?string;
    public final get_long(): long;
    public final get_double(): double;
    public final get_number(): ?string;

    public final set_nth_result_string(
                     long $which,
                     string $value): void;

    public final set_nth_result_long(
                     long $which,
                     long $value): void;

    public final set_nth_result_double(
                     long $which,
                     double $value): void;

    public final set_iterative_start_value(
                     bool $value): void;

    public final set_delayed(
                     bool $value): void;
}

12.8.1. Free an expression #

Used by unit tests.

public final
OpenCReport\Expr::free(): void;

12.8.2. Get the original expression string #

public final
OpenCReport\Expr::get_expr_string(): string;

12.8.3. Print an expression #

Used by unit tests.

public final
OpenCReport\Expr::print(): void;

12.8.4. Get the number of expression tree nodes #

Used by unit tests to compare the expression tree before and after optimization.

public final
OpenCReport\Expr::nodes(): long;

12.8.5. Resolve an expression #

public final
OpenCReport\Expr::resolve(): void;

12.8.6. Optimize an expression #

public final
OpenCReport\Expr::optimize(): void;

12.8.7. Evaluate an expression #

public final
OpenCReport\Expr::eval():
						 ?OpenCReport\Result;

12.8.8. Get the result of an expression #

public final
OpenCReport\Expr::get_result():
						 ?OpenCReport\Result;

12.8.9. Set expression result to a string value #

Useful for user functions.

public final
OpenCReport\Expr::set_string(
						 string $value): void;

12.8.10. Set expression result to a long value #

Useful for user functions.

public final
OpenCReport\Expr::set_long(
						 long $value): void;

12.8.11. Set expression result to a double value #

Useful for user functions.

public final
OpenCReport\Expr::set_double(
						 double $value): void;

12.8.12. Set expression result to a numeric value from string #

Useful for user functions. This allows using BC Math

public final
OpenCReport\Expr::set_number_from_string(
						 string $value): void;

12.8.13. Get number of operands of a expression #

Useful for user functions.

public final
OpenCReport\Expr::get_num_operands(): long;

12.8.14. Get nth operands' result of a expression #

Useful for user functions.

public final
OpenCReport\Expr::operand_get_result(
						 long $opidx):
						 ?OpenCReport\Result;

12.8.15. Compare the expression's current and previous results #

Used internally by the report executor and unit tests. Useful for implementing a custom report executor with breaks.

public final
OpenCReport\Expr::cmp_results(): bool;

12.8.16. Initialize expression results #

Used internally by the report executor and unit tests. Useful for implementing a custom report executor.

public final
OpenCReport\Expr::init_results(long $result_type):
						 void;

12.8.17. Get string value of an expression #

Used by unit tests.

public final
OpenCReport\Expr::get_string(): ?string;

12.8.18. Get long value of an expression #

Used by unit tests.

public final
OpenCReport\Expr::get_long(): long;

12.8.19. Get double value of an expression #

Used by unit tests.

public final
OpenCReport\Expr::get_double(): double;

12.8.20. Get numeric value of an expression as a string #

Used internally by unit tests.

public final
OpenCReport\Expr::get_number():
                         ?string;

12.8.21. Set nth result of an expression to a string value #

Used by unit tests.

public final
OpenCReport\Expr::set_nth_result_string(
						 long $which,
						 string $value): void;

12.8.22. Set nth result of an expression to a long value #

Used by unit tests.

public final
OpenCReport\Expr::set_nth_result_long(
						 long $which,
						 long $value): void;

12.8.23. Set nth result of an expression to a double value #

Used by unit tests.

public final
OpenCReport\Expr::set_nth_result_double(
						 long $which,
						 double $value): void;

12.8.24. Set iterative start flag of an expression #

Used internally by the report executor and by unit tests.

public final
OpenCReport\Expr::set_iterative_start_value(
						 bool $value): void;

12.8.25. Set expression to delayed #

A delayed expression's final value is precalculated, and this value is used in the output in every row of the report.

public final
OpenCReport\Expr::set_delayed(
						 bool $value): void;