4D v14

Video script

Home

 
4D v14
Video script

Video script  


 

 

In this video, we're going to learn to use forms for printing and adapt them to our needs.

In 4D, all forms can be printed. We don't make a distinction between the concept of a report (for printing) and that of a form (screen display).
You can use the same form for both data entry and for printing.

In most cases, especially for issues concerning different layouts or sizes, data entry and printing use separate forms.

It is common to have several forms for the same table. 4D doesn't impose any limits.

We can indicate the form to use either programmatically (we'll see how later) or by using interface tools in the Design environment where, here (Editor's note: In the Explorer) we can choose which form will be used as the input or output form. Then, when printing, we can again choose the form to be used.

To create a print form we'll use the wizard just like we did for the screen form.

We're going to create a form so we can print each technician and their interventions.

The TECHNICIANS table is selected so let's use the wizard.

  • Call the form "PRINT"
  • with the type "Detail Form for Printing"
  • Related tables
  • All the fields
  • "Advanced"
  • "Subform" => "Include a Subform"
  • for the INTERVENTIONS table (the table related as a child to the TECHNICIANS table)
  • Choose one of the List forms available for this table
  • Then OK
  • Edit

We then see:

  • In the upper right of the form, what we just set (the information related to the technician)
  • And below the list of interventions that by default has the "Variable" characteristic for the "Print Frame"
    (in other words, since each technician has around 500 or more interventions, if no limit is set, which is our case, we're going to have maybe 30 or 40 pages of interventions for this technician.)

Let's move on to the list of technicians.
Select one technician who will be our "subselection" (in other words, the only technician that we're going to process), then:

  • "File" => "Print"
  • We choose the print form
  • OK
  • Then OK on the print settings
  • Then preview

The preview shows 50 pages; obviously we can save some space by changing the size and the font of each field displayed.

The purpose is to see how easy it is to print using relations, without having to program anything, and here we have the list of interventions for the technician Bonaparte.

What we just did using the File => Print command could also be done through programming using the 4D print commands.

Furthermore, we'll see in later chapters how to improve the appearance and functionality of our forms, more specifically by learning how to handle form objects.

 
PROPERTIES 

Product: 4D
Theme: Printing forms

 
ARTICLE USAGE

Self-training ( 4D v13)
Self-training ( 4D v14)