|
|
|
|
|
- Overview
- Query in a window or in a page
- Overview
- Query in a control found in a WINDEV window or in a WEBDEV page
- Displaying the query result in a List Box, Combo Box, Looper or Table control
- Using a result item of the query in a control:
- Query in a report
The result of a select query can be used in: - a WINDEV and WINDEV Mobile application or a WEBDEV website,
- a window (created by the wizard in WINDEV or WINDEV Mobile),
- a page (created by the wizard in WEBDEV),
- a window control (table, list box, combo box, ... in WINDEV or WINDEV Mobile),
- a page control (looper, table, list box, combo box, ... in WEBDEV),
- a report.
The result of an insert query, update query or delete query can only be used in a program. Reports & Queries Reminder: Reports & Queries cannot be used to create: Insert queries, Update queries, Delete queries. For more details, see Running the query and handling the result with the WLanguage functions. Query in a window or in a page Overview A query can be used as data source for a window or for a page. The window or the page will display the records selected by the query.
Reports & Queries The queries created with Reports & Queries can be run from a WINDEV application only if this application supports the queries created with Reports & Queries Query in a control found in a WINDEV window or in a WEBDEV page All the controls that can be bound to a data source can be bound to one or more result items of the query (Edit control, List Box, Table, etc.).
A query can be used as data source for a control. The control will display the records selected by the query.
Reports & Queries The queries created with Reports & Queries can be run from a WINDEV application only if this application supports the queries created with Reports & Queries Displaying the query result in a List Box, Combo Box, Looper or Table control To display the query result in a List Box, Combo Box, Looper or Table control: - Open the window or the page into which the List Box, Combo Box, Looper or Table control will be added.
- Insert the control associated with the query (via the "Creation" tab of the ribbon). The control creation wizard starts.
- Specify that the information displayed in the control comes from an existing query.
- Select the query that will be associated with the control and the items that will be displayed in the control.
- Validate. The created control will display the information coming from the associated query.
- Type (if necessary) the following line of code in the initialization process of the control. This line of code is used to initialize and run the query, and to display the query result in the current control.
HExecuteQuery(<Name of associated query>)
Using a result item of the query in a control: To use a result item of the query in a control (other than a List Box, Combo Box, Looper or Table): - Open the window or the page into which a control associated with a query will be added.
- Create the control associated with the query.
- On the "Modification" tab, in the "Editing help" group, click "Description". The control description window appears.
- Go to the "Binding" tab in the control description window.
- Select the item to be displayed in the "Bound item" option.
- Validate. The created control will display the information coming from the associated query.
- Type (if necessary) the following line of code in the initialization process of the control. This line of code is used to initialize and run the query, and to display the query result in the current control.
HExecuteQuery(<Name of associated query>)
Remark: When creating a Table control associated with a query, you can: - Select the query in the "Project" pane directly.
- Perform a Drag and Drop toward the window. A table associated with the query is automatically created in the window or page.
A query can be used as data source for a report. The report will display the records selected by the query.
For more details, see Report based on a query.
Tip: On the "Query" tab, in the "Data binding" group, "Create a report" automatically creates a report based on the current selection query.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|