Kbase 15376: Printing Reports of the Metaschema w/ Results Report Builder
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
Printing Reports of the Metaschema w/ Results Report Builder
Printing Reports of the Metaschema
Using Report Builder or Results
Neither Report Builder nor Results can be used to create
reports using the metaschema tables. This is because these
tables are hidden and they are not associated by a common
field within each table. They are associated by a field in
one table and the record id (recid) of a record in another
table.. For example, records in the _field table are
associated to a _file record through a field in the _field
table called _file-recid of type recid. It holds the recid
of the corresponding _file record.
An example of how to associate the records using the 4gl
would be:
FOR EACH _field WHERE _field._file-recid = RECID(_FILE)
In order to created detailed reports of the metaschema using
Report Builder or Results, you will need to create a new
database. This database will contain a copy of the
metaschema fields you need, and a field of type recid. This
recid field will be used to hold the recid value in each
table for association.
As an example, In order to use Report Builder to create a report
of file names and all the associated filed names of each file,
you need to create a database similar to the following. The
field `file-recid' must be of type recid and be used as an
index.
Database Table Fields
matacopy filenames name-file
file-recid
fieldnames name-field
file-recid
Using the 4gl, you will now need to create a program to copy
the appropriate values from the databases metaschema tables
to these table. An example using the sports database
follows.
FOR EACH sports._file WHERE sports._file._file-name < "_":
CREATE metacopy.filenames.
ASSIGN
metacopy.filenames.name-file = sports._file._file-name
metacopy.filename.file-recid = RECID(sports._file).
END.
FOR EACH sports._field WHERE
sports._field._field-name < "_":
CREATE metacopy.fieldnames.
ASSIGN
metacopy.fieldnames.name-filed =
sports._field._field-name
metacopy.fieldnames.file-recid =
sports._field._file-recid.
END.
After running this code with both the sports and the sports
and the metacopy database connected, you will end up with a
database (metacopy) that contains the filenames and
fieldnames for the records in the Sports database. The
filenames and fieldnames table can be related by Results or
Report Builder using the file-recid field. You will need to
delete the records in the database and run the program again
if you update the database in order to transfer these
changes to the metacopy database.
K-Base entry 12229 lists the most commonly used elements of
the metaschema.
Progress Software Technical Support Note # 15376