Creating and saving a DataWindow object

Creating a DataWindow object

You create DataWindow objects using a wizard, and then enhance them in the DataWindow painter.

StepsTo create a DataWindow object in DataWindow Designer:

  1. In the New dialog box, click the DataWindow tab, select Tabular from the list of presentation styles, and click OK.

    The Choose Data Source for Tabular DataWindow page of the DataWindow wizard displays.

  2. Select Quick Select as the data source, select the Retrieve On Preview check box if it is not already selected, and click Next.

    DataWindow Designer connects to the EAS Demo DB V105 DWD database, and the Quick Select dialog box displays.

  3. Click the customer table in the Tables list box.

    This opens the table and lists its columns as shown in the illustration below. For this DataWindow, you will select four columns.

    The image shows the Quick Select dialog box.
  4. Click id, fname, and lname in the Columns list box in the order listed.

    Scroll down the list and click company_name.

    DataWindow Designer displays the selected columns in a grid at the bottom of the Quick Select dialog box.

    NoteSelection order determines default display order The order in which you select the columns determines their default left-to-right display order in the DataWindow object. If you clicked a column by mistake, you can click it again to clear the selection. You can also rearrange columns later in the DataWindow painter.

    You can use the grid area at the bottom of the dialog box to specify sort criteria (for the SQL ORDER BY clause) and selection criteria (for the SQL WHERE clause).

  5. In the grid area of the Quick Select dialog box, click in the cell next to Sort and below Id.

    A drop-down list box displays.

  6. Select Ascending from the drop-down list box.

    This specifies that the id column is to be sorted in ascending order.

    The image shows the sort drop-down list.
  7. Click OK.

    The DataWindow wizard asks you to select the colors and borders for the new DataWindow object. By default, there are no borders for text or for columns.

  8. Click Next.

    This accepts the border and color defaults. The DataWindow wizard summarizes your selections.

  9. Click Finish.

    DataWindow Designer creates the new DataWindow object and opens the DataWindow painter.

Understanding the DataWindow painter

The Design view in the DataWindow painter is divided into four areas called bands: header, detail, summary, and footer. You can modify the contents of these bands. For example, you can change their sizes, add objects (controls, text, lines, boxes, or ovals), and change colors and fonts.

In the Design view, DataWindow Designer displays a Heading band with default headings and a Detail band with the columns you selected:

The image shows the ID, First Name, Last Name, and Company Name column headings in the header band and the column names in the detail band.

The Preview view displays the DataWindow as it appears at runtime. DataWindow Designer displays data for all customers. The data is sorted in ascending order by customer ID, as you specified in the wizard.

The preview view shows the same column headings as the design view, but the first 10 rows also display.

NoteDisplaying the Preview view If the Preview view is not displayed, select View>Preview from the menu bar. If Preview is grayed, it is already displayed and you cannot select it. You can open only one Preview view at a time.

Save the DataWindow object

Now you name the DataWindow object and save it in the start.pbl library.

StepsTo save a DataWindow object:

  1. Select File>Save from the menu bar.

    The Save DataWindow dialog box displays with the insertion point in the DataWindows box.

  2. Type d_custlist in the DataWindows box.

  3. (Optional) Type the following comments in the Comments box:

    This DataWindow object retrieves customer names and company associations.
    
  4. Click OK.

    DataWindow Designer saves the DataWindow object and closes the Save DataWindow dialog box.