In this section: |
How to: |
The FanClub application can add names to the fannames data source, but users do not get much visual feedback from this task. The FanClub application needs to display the contents of the fannames data source.
This task is divided into the following steps:
To create a new form, in the Maintain Data Editor, type Winform Show formname when you have the case created.
Winform Show ShowFan; EndCase
How to: |
Your next step is to create a function named GetFans, which extracts all the information in the fannames data source and places it into a stack named GetFanStack. Try this yourself or see the next section for instructions.
Tip: Create the function and then use the Language Wizard to generate the code.
Case GetFans
but before
EndCase
The Language Wizard opens.
The Maintain Data language contains two commands to retrieve data from a data source. This window determines which one you want to use.
This window is where the Language Wizard determines from which data source you are reading the data. For more information, see Stacks and Implied Columns.
The Language Wizard should generate the following code:
Reposition fannames.CUSTOMER.SSN; Stack clear GetFanStack; For all next fannames.CUSTOMER.SSN into GetFanStack;
How to: |
You are going to display the fans from the fannames data source using an HTML table. An HTML table displays the contents of a data source stack in a read-only grid.
Another option for displaying the fans from the fannames data source is to create a report procedure in App Studio and execute this code whenever you open this form.
Use the Move up and Move down buttons to rearrange these fields so that they are in the following order: TITLE, FIRSTNAME, LASTNAME, COMPANY, and EMAIL, as shown in the following image.
You can change the appearance of any of these columns. For example, suppose you want to change the header titles for the FIRSTNAME and LASTNAME fields so that they read First and Last.
Your form resembles the following image.
How to: |
Your final step in creating your new form ShowFan is providing a way to open it from Form1. Do this by adding a button to Form1 that runs the GetFans function and opens the ShowFan form.
In the Maintain Data Editor, type Perform GetFans( ); in the case. The syntax should read as follows:
Case OnShowFanButton_Click Perform GetFans( ); Winform Show ShowFan; EndCase