Creating an Event to Call DataView Results
You can create an event on a form to launch the DataView Results form.
- Open the form and go into Design Mode.
- Add a button component to the form.
- With the button component selected, click the Events tab.
- Click the ellipsis(...) button for a Primary event.
- In the Event Handlers dialog box, click New.
- In the Event field of the Event Handler Properties dialog box, specify a name for the event.
- For the Response Type, select Run Form as Modal Child.
- Click the ellipsis button for Parameters.
- In the Events Handler Parms dialog box, click Type Specific Parameters.
- In the Specify Form Run Options dialog box, in the Form field, specify DataView Results (which might display as WBDataViewResults in the drop-down list).
- Click Set Variables.
- In the Edit Set Variable Values dialog box, click New.
- In the Edit Set Variable Value Pair dialog box, in the Target field, specify DataViewName.
- In the Value field, specify the name of the DataViewfor which you want to see results.
-
Optionally, use Steps 12 to 14 to create variables for a filter
and/or a layout to use for the resulting DataView display.
- For a filter, set
Target to
DataViewFilter, and set
Value to the name (or
an expression that resolves to the name) of the property you want to filter by.
For example, to filter the results by salesperson, you might end up with something like DataViewFilter=Slsman=FP(Slsman) or DataViewFilter=Slsman='JoeDoe'.
- For a layout, set
Target to
LayoutName, and set
Value to the name of
the layout you want to have displayed.
For example, to display a layout named LeadsUser, you might end up with something like LayoutName=LeadsUser.
- For a filter, set
Target to
DataViewFilter, and set
Value to the name (or
an expression that resolves to the name) of the property you want to filter by.
- Click OK until you return to the original form.
- Save your changes and test to verify that it produces the desired results.
Related topics
- About DataViews
- Understanding the WinStudio for event model