Tuto WINDEV 25
190 Part 4: Full application with data ▶ To manage the order date: 1. In the "Project explorer" pane, expand the "Control templates" folder. 2. Drag the control template named "TPLC_ChoosePeriod" from the "Project explorer" pane and drop it in the "WIN_Menu" window (beside the "Payment mode" control). 3. Select the created control template and display its description ("Description" from the popup menu). 4. In the description window, rename the control template. The new name is "CTPL_ ChoosePeriod". 5. Validate the description window. 6. Reposition and align the controls if necessary. ▶ We are now going to use the selected dates to pass them to the query as parameter: 1. Display the WLanguage events associated with the Table control: • Select the Table control. • Display the popup menu (right mouse click) and select "Code". 2. In the "Initializing" event of the Table control, replace the lines: MySource.ParamStartOfPeriod = "20160101" MySource.ParamEndOfPeriod = "20160331" by: MySource.ParamStartOfPeriod = EDT_StartDate MySource.ParamEndOfPeriod = EDT_EndDate In this WLanguage code, EDT_StartDate and EDT_EndDate are the names of two edit controls found in the control template. Their values are associated with the parameters ParamStartOfPeriod and ParamEndOfPeriod expected by the query. 3. Close the code editor. 4. Save the window by clicking among the quick access buttons.
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==