class OpenCReport\Query { public final get_result(): OpenCReport\QueryResult; public final navigate_start(): void; public final navigate_next(): bool; public final navigate_use_prev_row(): void; public final navigate_use_next_row(): void; public final add_follower( OpenCReport\Query $follower): bool; public final add_follower_n_to_1( OpenCReport\Query $follower, OpenCReport\Expr $match): bool; public final free(): void; }
The result is OpenCReport\QueryResult
.
See Section 12.7.
public final OpenCReport\Query::get_result(): OpenCReport\QueryResult;
Reset query (and all its followers) to go before the first row.
public final OpenCReport\Query::navigate_start(): void;
Navigate the query to the next row and return if the new row is valid. The current row of the query's follower queries are also moved to the next valid row.
public final OpenCReport\Query::navigate_next(): bool;
Usually queries do not have a uniform way to report the total number of rows, although some datasource types may have such a facility. Instead, they can report that the dataset has ended.
These functions expose an implementation
detail of the data traversal in OpenCReports.
There is a 3-row data cache in which there is
always the current row. One past row is kept
so e.g. break boundaries can be detected and
there is one row read-ahead to detect the
end-of-data condition early. These functions
allow to switch back and forth in the 3-row
data cache, making the previous or next row the
"current" one momentarily. The query must always
be the primary query of the report. Used by
unit tests that don't use
ocrpt_execute()
.
public final OpenCReport\Query::navigate_use_prev_row(): bool; public final OpenCReport\Query::navigate_use_next_row(): bool;
Usually queries do not have a uniform way to report the total number of rows, although some datasource types may have such a facility. Instead, they can report that the dataset has ended.
Add a query as an 1:1 follower to the main query object. The method returns whether the call succeeded.
public final OpenCReport\Query::add_follower( OpenCReport\Query $follower): bool;
Adding a circular reference between queries would fail.
Add a query and the matching expression as a follower to the main query object. The method returns whether the call succeeded.
public final OpenCReport\Query::add_follower_n_to_1( OpenCReport\Query $follower, OpenCReport\Expr $match): bool;
Adding a circular reference between queries would fail.
The call takes over ownership of the match object and it must not be explicitly freed.