4D v14

Video script

Home

 
4D v14
Video script

Video script  


 

 

For this video, we're going to learn how to use the Quick report editor.

To change things, we're going to move our database to a Mac.

  • First, we'll exit 4D
  • then we'll copy our first database onto a file exchange
  • and then we'll switch to a Mac.

On the Mac, we'll find the file that we transferred on Windows Exchange which is actually a package whose contents can be displayed.

The contents contain:

  • the structure
  • the data
  • the index files
  • and so on.

To start an application on the Mac, you can drag either the .4dbase file or the .4DB file like you do on Windows.

  • Let's drag the file onto an instance of 4D v13.
  • On start-up, without any conversion whatsoever taking place, we'll see the window as we programmed it, with the possibility of seeing all the technicians, all the interventions and so on.

The main interest in establishing a database is to store data. For the moment, we have done this by displaying data on screen in a form that was predefined by the programmer.

However, in many cases, your users may want to adapt their data extractions to particular needs not specified in the specifications or on an ad hoc basis.

The Quick report editor quickly meets this need.
You can use it to display data from the current selection, in other words, the results of a previously performed query.

You can open the Quick report editor from the toolbar, or by programming it.

We're going to copy the contents of the "Query" button and insert it into the "Report" button while replacing QUERY with QR REPORT

 QR REPORT([TECHNICIANS];Char(1);True;True;True)


which takes 5 parameters:

  • the table name
  • the document name or we can pass Char(1) so that it displays the standard Quick report editor.

then 3 more parameters that we're going to set to TRUE

  • the first allows hierarchical navigation using relations
  • the second allows for a wizard
  • and the 3rd lets you perform a complementary search in the Quick report editor.

Of course, we're also going to adapt the Technicians table.

  • We click on the Technicians button
  • "All" then on the "Report" button

The screen consists of 4 areas:

  1. The top part with the menu bar, tool bar and a gray rectangle for configuring the columns
  2. The green area where you can choose a table, perform a query, set the report type or open the wizard
  3. The fields column for the selected table
  4. The column for sort orders

To quickly produce a report:

  • Double-click on the names of the fields. They will appear in the upper part.
  • Then choose "Print preview" either using the button or from the File menu (on Mac OS, print previews are automatically done in PDF and on Windows there are in XPS)
  • To change the sort order, drag one or more fields to the sorting area

You'll notice that a subtotal row is displayed in the area for each sort criteria that you add.

In subtotal rows, you can add summary calculations by right-clicking on the intersection where the row and column meet.

To go further using this editor, we're going to change pages and display the list of interventions.

We can perform a search before using the Quick report editor, but we can also do so directly from the editor.

The calculation that we're going to perform concerns the number of interventions made by technicians for a given period. So first we're going to search the interventions for the desired period, for example December 2011:

  • Intervention dates past 1/12/11
  • Intervention dates before 31/12/11
  • Query = > We get 314 records out of 11732.

Now we double-click on "Technician_initials", added to the upper part of the screen, and Object. If we print the form as it now stands, we'll get a list of 314 records for December 2011.

But what we want to get is the number of interventions for each technician.

So first of all we need to:

  • Sort by technician by dragging the "Technicians_initials" field into the sort area. A subtotal line is added to the upper part of the screen, where we can add calculations.
  • We also drag the "Object" field as the 2nd sort criteria, which lets us get the distribution of interventions per technician. A 2nd subtotal is also added.

Printing will give us the same list as before, but sorted by the specific criteria.

Since we have not indicated anything in the subtotal rows, they do not appear on screen.

To count the number of interventions, just right-click on one of the columns in the Technician_Initials subtotal row and choose Count.

When it is printed, this row now appears with the number of interventions per technician: 44 interventions for the same technician.

We can do the same thing for the Object subtotal row and we get 10 training sessions, then 9 and so on for a total of 44 interventions for the technician.

The detail rows don't really concern us. We can right-click on the title of the Detail row to hide it. Only the subtotal rows are printed.

To indicate that the body is hidden, its row is filled in with a gray grid.

During printing, we can see the distribution but since we have hidden the Detail row, we can no longer see which technician and which object go with these values.

To find out, we can just type the # symbol in the subtotal rows.

Let's begin with the technician: we can now see the name of the technician next to the number of interventions.

We can do the same with the object:

  • 1st click
  • 2nd click
  • #

When we print it, we can see that it now corresponds to what we wanted: the number of interventions divided by type of intervention and with the total for each technician.

The Quick report editor is a powerful tool where you can add and modify columns, perform programmed calculations and then send the resulting reports not only to a printer but also, for example, to a disk file.

A system dialog box lets you name your file and choose its location.

We find the export and if we open it with a text editor or a spreadsheet, the information is all there.

 
PROPERTIES 

Product: 4D
Theme: Quick reports - exports

 
ARTICLE USAGE

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