13.07.2015 Views

Reports & Queries - Source : www.pcsoft-windev-webdev.com

Reports & Queries - Source : www.pcsoft-windev-webdev.com

Reports & Queries - Source : www.pcsoft-windev-webdev.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

You can:• select one of the possible values among the values found in the data file.• view the entire data file.Caution: This option is available only if the Live Data is enabled. The Live Data is configured in the "LiveData" tab of the project description. See the online help (keyword: "Live Data") for more details.4. Validate. The result of the query is displayed according to the specified values.Note: If no parameter is selected (parameter not checked), the conditions that use the parameters will beignored.5.3.3 Using a query with parametersA query with parameters can be used:• in a window or in a page.• in a table, list box, <strong>com</strong>bo box or looper.•in a report.• in any case, the entered parameters can be managed in an edit control.Using a query with parameters in a window or in a pagePrincipleWhen creating a window (or a page), this window (or this page) can be based on a query with parameters. Theparameters of the query can be entered in a previous window (or page) for example.To use a window (or a page) based on a query with parameters, the query must be run (HExecuteQuery):• before opening the window (or the page).• in the declaration code of the global variables of the window (or page).The necessary parameters must be passed when running the query. These parameters can be passed:•in HExecuteQuery directly.• by using the following notation ., then in HExecuteQuery.See the “Two methods for passing parameters to a query”, page 217 for more details.ExampleTo display the list of orders placed in year XXXX, the user performs the following operations:• type the requested year in the WIN_EditParam window.• click the "Show the result" button. The WIN_OrderList window is displayed. This window is based on theQRY_QryParamOrder query. This query is used to select the orders placed on the date specified by theuser.The following code is used to:• open the WIN_EditParam window,• retrieve the value entered by the user,• run the QRY_QryParamCustomer query.1. Opening the window for entering parameters in the initialization process of the WIN_OrderList window:-- Initialization process of WIN_CustomerForm windowQRY_ParamQuery is string// Open the WIN_EditParam window// retrieve the input performed by the userQRY_ParamQuery = Open(WIN_EditParam)214Part 2: Query editor

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!