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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2. Running the query in the initialization process of the OrderList window:// Run the queryHExecuteQuery(QryParamCustomer, hQueryDefault, ParamQuery)// Similar code ://QryParamOrder.Year = ParamQuery//HExecuteQuery(QryParamOrder)Using a query with parameters in a table, a looper, a list box, a <strong>com</strong>bo boxOverviewA table, a list box, a looper or a <strong>com</strong>bo box can be used to display the content of a data file or query.A table, a list box, a looper or a <strong>com</strong>bo box can be linked to a query:• independent. This query already exists in the project: select this query among the queries of your project.• included in the table, list box or <strong>com</strong>bo box: this query will be created in the wizard for creating the Tablecontrol. This query will be available for this control only and it will be saved with the window that is using it.In this case, the window contains all the necessary elements.• with parameters: this query (independent or embedded) requires parameters to run and to display theresult in the table.Note: this paragraph only presents the tables but the operating mode is similar for the list boxes, the <strong>com</strong>bosboxes and the loopers.Browsing tables based on independent queriesA browsing table based on an independent query (without parameter) displays the records of this query.By default, the query is run and loaded in memory when it is first used. The result of a query used in a browsingtable remains in memory when the associated window or page is closed. This query will not be re-runwhen it is re-used.To re-run this query, you must use:• HCancelDeclaration:•If HCancelDeclaration is not called, the next initialization of the table control (when the window is reopenedfor instance) will not re-run the query. The data retrieved during the last query execution will beused. If the table is based on a query with parameters, see "Browsing table based on a query withparameters (embedded or not)".•If HCancelDeclaration is called, the next initialization of the table control (when the window is re-openedfor instance) will re-run the query.• TableDisplay (or ListDisplay for a list box): to force the query to re-run, use TableDisplay associated with thetaReExecuteQuery constant.Browsing tables based on an embedded query (without parameter)A browsing table based on an embedded query (without parameter) displays the records of this query.By default, the query is run and loaded in memory when the table is displayed. The result of an embeddedquery used in a browsing table is automatically cleared from memory when the associated window is closed.This query will be re-run when it is re-used.To force the re-execution of the query, use TableDisplay (or ListDisplay for a list box) associated with thetaReExecuteQuery constant.Browsing table based on a query with parameters (embedded or not)When a browsing table is linked to a query with parameters (embedded or not), parameters must be passedto the query before it is run.If these parameters are not specified before the first execution of the query, the query will not be run and thetable will remain empty.Part 2: Query editor 215

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

Saved successfully!

Ooh no, something went wrong!