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.

To pass parameters to the query, you can use:• the following notation. = xxx. = xxx. = xxxIn this case, the query is automatically run when the table is initialized.Note: you also have the ability to use one of the following notations :- My<strong>Source</strong>:My<strong>Source</strong>. = xxxMy<strong>Source</strong>. = xxxMy<strong>Source</strong>. = xxx- the indirection:{"."} = xxxor{""}. = xxx• HExecuteQuery.One of these two methods can be used in the declaration code of the global variables of the window or in theinitialization code of the table.Special cases:• Initializing a Table control or using TableDisplay without the taReExecuteQuery constant.• If no query parameter was modified since the last query execution, the query will not be re-run. Thetable will display the records corresponding to the last query execution.• Once the query parameters are modified, TableDisplay (or ListDisplay for a list) is used to re-run thequery. The table displays the records corresponding to the specified parameters.•Using TableDisplay with the taReExecuteQuery constant.To force the re-execution of the query, use TableDisplay (or ListDisplay for a list box) associated with thetaReExecuteQuery constant.Reminder: the structure of the query parameters being reinitialized whenever the query is run, don’t forgetto redefine the requested parameters before you use this function.Using a query with parameters in a reportPrincipleTo use a report based on a query with parameters, the query must be run before opening the report. Thequery can be run by iInitReportQuery. This function is used to run the query and to pass parameters to thisquery. This function can be called:• in the initialization code of the report,• before iPrintReport.ExampleThe WIN_CustomerForm window is used to browse the characteristics of customers. For each customer, theuser can click the BTN_PrintOrder button to print the RPT_CustomerOrdReport report. This report is associatedwith the QRY_QryCustomerOrd query that selects the orders placed by a given customer.216Part 2: Query editor

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

Saved successfully!

Ooh no, something went wrong!