- Internal Report control: report based on a query with parameters
- Executing a query and a report based on this query
- Freeing the query
In french: <Etat>.InitRequête
Initializes the query linked to the report (for a query with parameters). This function can be called:
- If the report is linked to a query with no parameter, use <Report>.Print.
- If the report is linked to a query (with or without parameters) that uses a specific connection (connection to a database via an OLE DB provider for example), use <Report>.InitQueryConnection.
- If the report is included in a composite report, <Report>.InitQuery must be called in the "Initializing" event of the report.
: A specific configuration is required to use this function in Linux. For more details, see Print in Linux
|If the query is created with Reports & Queries, there is no need to use <Report>.InitQuery to specify the query parameters. Indeed, when a report based on a query with parameters is run from Reports & Queries, a window allows you to enter the query parameters.|
<Report used>.InitQuery([<Parameter 1 of query> [... [, <Parameter N of query>]]])
<Report used>: Report name
Logical name of report to print.
<Parameter 1 of query>: Type of query parameter (optional)
First parameter of query defined as report source (if the query expects a parameter).
<Parameter N of query>: Type of query parameter (optional)
Last parameter of query defined as report source (if the query expects a parameter).
Internal Report control: report based on a query with parameters
If the report associated with an "Internal Report" control is based on a query with parameters, use <Report>.InitQuery to pass the parameters to the query. This function must be used in the "Before printing" event of the block containing the "Internal report" control.
Executing a query and a report based on this query
When printing a report based on a query, if the query has already been executed, it is not executed again. To force the re-execution of the query (add records, for example), simply use <Source>.ExecuteQuery
Freeing the query
When printing a report based on a query initialized by <Report>.InitQuery
, the query is freed at the end of the report print (behavior identical to the call to <Source>.CancelDeclaration
- If some of the parameters expected by the query are not specified (value corresponding to NULL for example), the selection conditions corresponding to these parameters will be ignored.
- If the number of parameters specified in <Report>.InitQuery is greater than the number of parameters expected by the query, the additional parameters are ignored.
Business / UI classification: Neutral code
This page is also available for…