Laying out forms and reports

Paradox lets you create forms and reports based on data models. You can then apply a layout style to the form and report designs to modify the way they look. In addition, you can apply style sheets to forms and reports and specify page layouts.

In the section, you'll learn about

  creating a form or report based on a data model
  
  applying a layout style to a form or report
  
  working with multi-table layouts
  
  modifying and removing fields
  
  creating and applying style sheets
  
  saving a form or report design
  
  specifying the page layout of a form
  
  specifying the page layout of a report
  
  creating, modifying, and deleting report page size definitions
  
Creating a form or report based on a data model

When you are designing a form or report, the design is based on a data model. A data model is a graphical representation of a database that is used to create a form or report. For more information about creating a data model, see "Data modeling." Once you create or choose the data model for a form or report, you choose a layout style and then modify the form or report design. For more information about applying a layout, see "Applying a layout style to a form or report." You can also create a blank form or report that is not bound to a table.

To create a form or report based on a data model

1	Click File  New, and click one of the following:

  Form
  
  Report
  
2	Click Data model.

3	Choose Data models from the list box at the bottom of the Data model dialog box.

4	Choose the drive and folder where the data model is stored.

5	Click OK.

6	In the Design layout dialog box, choose a layout for your form or report.

Note

  For more information about choosing a form or report layout, see "Applying a layout style to a form or report."
  
To create a blank form or report

1	Click File  New, and click one of the following:

  Form
  
  Report
  
2	Click Blank.

3	Click Format  Data model.

4	Choose Data models from the list box at the bottom of the Data model dialog box.

If Samples are installed, a list of data models will display in the list.

5	Choose the drive and folder where the data model is stored.

6	Click OK.

Note

  For more information about choosing a form or report layout, see "Applying a layout style to a form or report."
  
Applying a layout style to a form or report

When you design a form or report, you need to apply a layout style. You can choose a single-record layout, table layout, or multi-record layout.

A single-record layout lets you display a form or report one record at a time, which means that each page of a form or report contains only the data from one row or record of the table on which it is based. This format is convenient when the table in your data model has records that contain large amounts of information, such as a memo field, or has a physically large field, such as an OLE object or graphic.

A multi-record layout lets you display several records at a time by using a field layout that repeats a specified number of times horizontally, vertically, or a combination of both across the page. A common use of a multi-record form or report is to create mailing labels. Each label is represented by a group of fields (such as name, address, city, state, and zip code) in a layout, which is repeated for each record. For more information about multi-table layouts, see "Working with multi-table layouts."

The following graphic illustrates a multi-record report that uses fields from the sample customer table.

When you print or preview this report, the pattern of the fields is repeated in the master record region for every record in the customer table.

You can also apply a tabular layout to a form or report, which lets you display your data in columns and rows.

To apply a single record layout

1	With a form or report open in the design window, click Format  Data model.

2	Choose Data models from the list box at the bottom of the Data model dialog box.

If Samples are installed, a list of data models will display in the list.

3	Choose the drive and folder where the data model is stored.

4	Click OK.

5	Click Format  Layout.

6	Click the Layout tab.

7	In the Style area, enable the Single record option.

8	In the Field layout area, enable one of the following options:

  By columns-lets you lay out fields in columns
  
  By rows -lets you lay out fields in rows
  
Tips

  You can remove field labels by disabling the Label fields check box. A field is a text object that contains the field name.
  
  You can also specify that field labels do not display when running a form or report by right-clicking a field label and choosing Properties. Click the Run Time page and disable the Visible check box.
  
To apply a multi-record layout

1	With a form or report open in the design window, click Format  Data model.

2	Choose Data models from the list box at the bottom of the Data model dialog box.

If Samples are installed, a list of data models will display in the list.

3	Choose the drive and folder where the data model is stored.

4	Click OK.

5	click Format  Layout.

6	Click the Layout tab.

7	In the Style area, enable the Multi-record option.

8	In the Field layout area, enable one of the following options:

  By columns -lets you lay out fields in columns
  
  By rows -lets you lay out fields in rows
  
9	In the Multi-record layout area, enable one of the following options:

  Horizontal -displays repeated record regions across a page
  
  Vertical -displays repeated record regions down a page
  
  Both -displays repeated record regions across and down a page
  
Note

  The record object inside the multi-record object is a container for the records. If you make the record object too small, fields will be eliminated from the Define multi-record object dialog box to make the record fit the container.
  
To apply a tabular layout

1	With a form or report open in the design window, click Format  Layout.

2	Click the Layout tab.

3	In the Style area, enable the Tabular option.

Working with multi-table layouts

When you have more than one table in a data model, you need to specify a multi-table layout when creating a form or report. Data models based on multiple tables can include one master table and one or many detail table(s). You can only show the detail table when the form or report is made up of a one-to-many relationship. You can also change the way detail tables look by specifying the style.

In a multi-table layout, detail records are placed before the associated master records by default. However, you can place master records before unnested detail tables.

In a one-to-many form design, you can display master records in a multi-record object and place detail records inside that multi-record object. This is called nesting detail records within the master. The detail tables are displayed in a multi-record object or a table, depending on which option you choose. If you are creating a report from a multi-record object form design, the detail records must be nested. When you design a report layout, detail objects are automatically nested within master objects whenever you display several master records.

When you create a report design, it should be structured such that each record appears on a single page. If you have many detail records for each master record, or many levels of nesting, try to fit all the detail records on a single page before running the report. You can do this by limiting the number of detail records.

To specify detail table style

1	In the design window, open a form or report that is made up of a one-to-many relationship.

2	Click Format  Layout.

3	Click the Detail tables tab.

4	In the Detail table style area, enable one of the following options:

  Table  - displays detail tables in rows and columns
  
  Record  - displays several records at a time
  
You can also	

Display multiple records across the page	In the Multi-record layout area, enable the Horizontal option.

Display multiple records down the page	In the Multi-record layout area, enable the Vertical option.

Displays multiple records across and down the page	In the Multi-record layout area, enable the Both option.

To place master records before detail tables

1	In the design window, open a form or report that is made up of a one-to-many relationship.

2	Click Format  Layout.

3	In the Style area, enable the Single record option.

4	Enable the Fields before tables check box.

Notes

  In a form, master records can be displayed in either the tabular style or the multi-record style. Detail records can be either nested in the master multi-record object or separate from either a master table or multi-record object.
  
  In a report, the master records are always displayed in the multi-record style, and the detail records can be displayed in either a table or a multi-record object nested in the master multi-record object.
  
To nest detail records in a form

1	With a form open in the design window, click Format  Layout.

2	In the Style area, enable the Nested check box.

To limit the size or number of detail records in a report

1	With a report open in the design window, right-click the table or multi-record object that contains the detail records, and click Properties.

2	Click the Run time tab.

3	Enable By duplicating object.

Tip

  You can run the form to see if you succeeded in limiting the number of detail records by clicking View  View data.
  
Modifying and removing fields

Paradox lets you specify which fields to display in a form or report design and in which order you want them displayed. You can also remove fields from your design.

To modify fields in the design

1	With a form or report open in the design window and a data model already selected, click Format  Layout.

2	Click the Fields tab.

3	Choose a table from the Table list box.

4	Choose a field from the Selected fields box.

5	In the Order area, click one of the following buttons:

  Up arrow  - moves fields up the list
  
  Down arrow  - moves fields down the list
  
Note

  When you create a report, fields for the date, the page number, and the title are automatically added to your design. You cannot remove these fields in the Design layout dialog box; you must remove them in the report design window.
  
To remove a field from a design

1	With a form or report open in the design window, click Format  Layout.

2	Click the Fields tab.

3	Choose a field from the Selected fields box.

4	Click Remove field.

Tip

  You can restore the field you removed by clicking Reset fields.
  
Creating and applying style sheets

Paradox lets you create and apply style sheets to forms and reports. Style sheets specify the color, size, and style of all of the design objects, such as buttons, boxes, and fields that you use to create forms and reports. Form style sheets are saved as Screen style sheets (.ft) and report style sheets are saved as Printer style sheets (.fp).

When you apply a style sheet, any changes made manually, such as adding design objects, are replaced by style sheet properties. If you want to make manual changes to the form or report, apply the style sheet before making the changes.

Style sheets are stored in the current working directory. However, you can save the style sheets in the root directory. By saving to the root directory, you can access the style sheets from any project.

To create a style sheet

1	With a form or report open in the design window, click Format  Style sheet.

2	Click Save as.

3	Choose the file and folder where you want to store the style sheet.

4	Type the filename of the new style sheet in the Filename box.

5	Click Save.

To apply a style sheet to a form or report

1	Click Tools  Settings  Preferences.

2	Click the Forms/reports tab.

3	In the Designer style sheets area, choose a style sheet from one of the following list boxes:

  Screen style sheet  - represents form style sheets
  
  Printer style sheet  - represents report style sheets
  
Tip

  You can apply a different style sheet while in design mode by clicking Format  Layout and choosing a style sheet from the Style sheet list box.
  
To move the style sheet to the Paradox root directory

1	Click Tools  Utilities  Rename.

2	Choose one of the following file types from the Files of type list box:

  Screen style sheets (.ft)  - represents form style sheets
  
  Printer style sheets (.fp)  - represents report style sheets
  
3	Choose the file and folder where the style sheet is stored.

4	Type the new path for the style sheet in the Filename text box.

For example, if you installed Paradox to the default directory, rename the file to [INSTALLDIR]\Paradox\pdoxHome\Myfile.FT.

5	Click Rename.

Saving a form or report design

Paradox lets you save a form or report design, including all the properties associated with that document.

To save a form or report design

1	With a form or report open in the design window, click File  Save.

2	Choose the file and folder where you want to save the file.

3	Type a name for the form or report in the Filename box.

4	Click Save.

Specifying the page layout of a form

Paradox lets you specify the page layout of an open form. The page layout determines the page size of the form. You can also specify the on-screen page layout options for all new forms. By default, the on-screen layout options that you specify will automatically be applied to all the new forms that you create.

To specify the page layout of a form

1	With a form open in the form design window, click File  Page setup.

2	In the Custom area, type a value in the following boxes:

  Width
  
  Height
  
3	Choose a unit of measurement from the Units list.

To specify the on-screen layout of new forms

1	Click Tools  Settings  Preferences.

2	Click the Forms/reports tab.

3	In the Onscreen size area, disable the Size to desktop check box.

4	Enable one of the following unit of measurement options:

  Inches
  
  Centimeters
  
  Pixels
  
5	Type values in the following boxes:

  Width
  
  Height
  
Tip

  You can specify that new forms are the same size as the desktop by enabling the Size to desktop check box.
  
Specifying the page layout of a report

Paradox lets you specify the page layout properties of a report. You can apply a predefined page layout to a report. You can also create new page layout definitions. For more information about creating page layout definitions, see "Creating, modifying, and deleting report page size definitions." You can specify the page orientation and margin settings for reports. In addition, you can specify a paper source when you are printing a report page. For example, you can specify that the paper be chosen from your printer's cassette. In addition, certain page layout options, such as choosing a paper source, will vary depending on the printer(s) you have installed.

To choose a page layout for a report page

1	With a report open in the design window, click File  Page setup.

2	Click one of the following buttons to regenerate the forms list:

  Regenerate standard forms - generates a list of predefined page sizes that are accepted by most printers
  
  Regenerate printer forms - generates a list of predefined page sizes that are available for the printers you have installed
  
3	Choose a predefined page size from the forms list.

Note

  When you click Regenerate printer forms, the list includes all the predefined page sizes that are available for the printers you have installed and not just the printer you have selected. Therefore, if you select a page size from the list, your selection may not be available for the printer you have selected.
  
Tip

  You can toggle between the standard forms and printer forms lists by clicking Display printer/standard forms.
  
To specify the page orientation for a report page

1	With a report open in the design window, click File  Page setup.

2	In the Orientation area, enable one of the following options:

  Portrait-prints text and graphics on a page where the height is greater than the width
  
  Landscape-prints text and graphics on a page where the width is greater than the height
  
To specify margins for a report page

1	With a report open in the design window, click File  Page setup.

2	In the Margins area, type values in any of the following boxes:

  Left-lets you specify the left margin position
  
  Right-lets you specify the right margin position
  
  Top-lets you specify the top margin position
  
  Bottom-lets you specify the bottom margin position
  
You can also	

Set all four margin settings equal to the last margin size that you specified	Click Equal.

Set all four margin settings to the minimum value that the current printer settings allow	Click Minimum.

To specify a paper source for a report page

1	With a report open in the design window, click File  Page setup.

2	Choose a paper source from the Paper source list box.

Creating, modifying, and deleting report page size definitions

Paradox lets you create new page layout definitions for reports. You can base a new report page definition on an existing definition. The page definitions you create are saved and you can apply them to pages. You can also modify and delete the definitions you create. A page definition contains the layout specifications, such as page width, height, and paper source, of a page.

To create a new report page size definition

1	With a report open in the design window, click File  Page setup.

2	Click Add new form.

3	Type a name for the new page size in the Name box.

4	In the Show page size for area, click one of the following:

  All printers-lets you display page size definitions for all installed printers
  
  Current printer only-lets you display page size definitions for the selected printer
  
5	Choose a predefined page type from the Type list box.

6	Choose User defined size from the Size list box.

7	Type values in the following boxes:

  Width
  
  Height
  
8	Choose a page source from the Source list box.

9	In the Printing adjustments area, choose one or both of the following to adjust where text will print on the page:

  Choose Up or Down from the Vertical box, and type a value in the box to the right of the Vertical box to specify how much to move text up or down.
  
  Choose Left or Right from the Horizontal box, and type a value in the box to the right of the Horizontal box to specify how much to move text left or right.
  
Tip

  If you do not want to define your own size of paper, choose a predefined size from the Size list box. When you choose a predefined size, the measurements of your selection are reflected in the Width and Height boxes.
  
To modify a report page size definition

1	With a report open in the design window, click File  Page setup.

2	Choose a page size definition from the list.

3	Click Edit form.

4	In the Show page size for area, enable one of the following:

  All printers-lets you display page size definitions for all installed printers
  
  Current printer only-lets you display page size definitions for the selected printer
  
5	Choose a predefined page type from the Type list box.

6	Choose User defined size from the Size list box.

7	Type values in the following boxes:

  Width
  
  Height
  
8	Choose a page source from the Source list box.

9	In the Printing adjustments area, choose one or both of the following to adjust where text will print on the page:

  Choose Up or Down from the Vertical box, and type a value in the box to the right of the Vertical box to specify how much to move text up or down.
  
  Choose Left or Right from the Horizontal box, and type a value in the box to the right of the Horizontal box to specify how much to move text left or right.
  
Tip

  If you do not want to define your own size of paper, choose a predefined size from the Size list box. When you choose a predefined size, the measurements of your selection will be reflected in the Width and Height boxes.
  
To delete a report page size definition

1	With a report open in the design window, click File  Page setup.

2	Choose a page size definition from the list.

3	Click Delete form. 




