In this section:
How to: |
The FanClub application can add names to the fannames data source, but end 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:
WebFOCUS Maintain opens the form in the Form Editor.
(Change the value for the Title property in the property sheet.)
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 Maintain language contains two commands to retrieve data from a data source. This window determines which one you want.
This window is where the Language Wizard determines from which data source you are reading the data. Remember that if you select a field in one segment, the rest of the fields in that segment are also extracted. See Stacks and Implied Columns for more information.
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 WebFOCUS Developer Studio and execute this code whenever you open this form.
button.
WebFOCUS Maintain opens the Control Columns dialog box, where you define the contents of your HTML table.
Note: Make sure you did not select AddFanStack.
The Control Columns dialog box now displays the columns in the stack GetFanStack.
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.
You can change the appearance of any of these columns by opening the Table Column dialog box. For example, suppose you want to change the header titles for the FIRSTNAME and LASTNAME fields so that they read First and Last.
You can also change the width, justification, font, and color.
Your form resembles the following:
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.
control.
WebFOCUS Maintain adds the following code:
Case OnShowFanButton_Click EndCase
You see the following pop-up window.
Comment text appears with the Winform Show command that explains how to show a non-persistent form. Because you want a persistent connection for this form, leave the comment text as is.
| WebFOCUS |