Producing Reports

INGRES provides three different approaches to obtain Reports on data in the database. These are

Preview (Default) Reports are very much 'Rough & Ready' and although useful in many situations, are of limited use for producing Business reports. However, RBF and Report Writer can be used to create customised reports of varying degrees of complexity.

Further Reading to compare the alternatives Ref: "Introducing Ingres" Part 1 chapter 6 & "Ingres Thru Forms & Menus" Part 1 chapter 13

RBF - Preview (Default) Reports

This is the simplest & quickest method to obtain Reports. This facility is accessed from the main menu, either through the REPORTS option, or via the Ingres TABLE option. The advantage when using PREVIEW from within the Reports utility is that you can readily see what other reports you may already have listed in your Report Catalog.

Preview can generate a default report based on a TABLE or VIEW(Virtual Tables) held in your database. The entire contents of a Table/View will be presented, based on one of the following report styles:-

Ingres will present the data in the default format for the report style you choose. It can either be displayed on the screen or printed as a hard copy.

REF texts:

Default RBF exercise - do this now.

Ingres RBF - Visual Report Editor development Tool

The RBF Visual Report Editor development tool is one way of customising reports.

The RBF utility will automatically create and display a Default Report Layout for the object you choose to base your report on. This object can be a Table, View, or a JoinDef.

The Default Report Layout Ingres presents, is a basic, standard layout containing a number of Report sections. Each report style (e.g. Tabular, Block etc..)has its own slightly different default report layout, hence not all report sections will appear in all Default Report Layouts.

You EDIT this Default Report Layout to your own level of customisation using the Visual Report Editor.

Once you have completed your customised Report, it can be saved in the database using the Save menu option within RBF. In effect you have saved a Report specification which can be invoked at any time from the Report Catalog Frame by choosing Go(Enter).

REF texts:

Visual Report Editor exercise - do this now.

Ingres Report Writer

This facility allows us the greatest control over the detailed content of our customised Report. Essentially this facility is a Report Specification Language offering a range of commands to enable us to produce detailed, complicated report contents; additionally we can base our report on a number of different Tables Views etc.

(The source code is entered via the Systems Editor e.g. Ined, and compiled using sreport etc.. as in exercise)

Ingres 6.4 helps us to avoid using the Report Writer Language except for the more complicated requirements, and even then we can let Ingres do a considerable amount of the work for us.

As we saw from the previous exercise, when we Saved a report Specification in the Report Catalog which we could then execute from within RBF at any time. This Report Specification can in fact be converted into the equivalent Report Writer Language statements; once converted they can be further edited, then executed to produce a further enhanced report format.

Editing & Compiling Report Specifications

The ARCHIVE operation is used to convert an RBF report Specification to Report Writer language statements. This file of source code should have a suffix .rw. The System will automatically add this suffix of .rw (e.g. reportfilename.rw ) when we use the ARCHIVE option. This source file can now be edited outside the Ingres environment using a Text Editor.

We can compile the code from the command line, (UNIX) using

sreport databasename reportfilename.rw
(the filename 'reportname.rw' as used in ARCHIVE and Sreport commands need not be the same name as that of the actual Report name as held in the Report Catalog) .

Sreport adds the name of the report to the Catalog when it generates an error-free compiled version (the report Catalog entry is given the name of the report as found in the .NAME statement in the source code). We can execute the compiled report specification from either the command line, i.e.,report databasename reportname or from within the RBF Report Catalog Frame.(hence the reportname is that as listed in the Reports Catalog)

REF texts:

Report Writer exercise - do this now.

Continue with this trainer


This WWW material is copyright De Montfort University and may only be reproduced or used if this copyright notice is included.
This page is maintained by John Skelton. Comments or suggestions for improving this material can be emailed to jas@dmu.ac.uk) and will be gratefully received.