What is a report?
A report describes a list (or a form) that
shall be printed out by the Ebus program. The definition of a report in the Ebus-J
is so general that any list (or form) can be created with it.
A report does not consist of more than five
types of blocks. Only the data block is compulsory, all other blocks can be
missing. A block ‘exists’ as soon as at least one line has been defined for it.
|
a) Head block |
The head block is always printed at the same
position at the beginning of every page. |
|
b) Foot block |
The foot block is always printed at the same
position at the end of every page. |
|
c) Data block |
The data block is the part of the report that
repeats itself. Usually the data block is printed once for every data record.
However, there are commands in the programming language that can break this
rule. |
|
d) Group change block |
The group change block is printed before a
data block any time the checkbox group change has been set with
a report field of the data block and a group change has taken place (i.e. the
value of the report field has changed in comparison to the previous data
block). The group change block can be used to print subtotals or information,
for example. |
|
e) Report ending block |
The report ending block is printed at the end
of the report behind the group change block (if existent). The report ending
block can be used to print totals on the list, for example. |
Report
run in the Ebus program
First the report head (if existent) is printed.
If an Index File has been specified for the
report, a START or STARTS (according to the specified key) will be
executed internally and the data block will be printed. After that, the index
file will be read with READ-NEXT or READS-NEXT until the file end is reached or the
command ENDREP is executed in a macro of the report. The data block is printed
once for every data record read.
If no Index File has been specified for the
report, the data block will be printed again and again. In this case the macros
of the report must be used to control what data records shall be read or
if any shall be read at all. Furthermore, the report must be closed in a
macro by the instruction ENDREP,
otherwise it will run endlessly.
Every block consists of a certain number of
lines. The lines are built up and printed one for one. For every report field
of the line the value of the respective variable is inserted from left to right
at the position of the report field, when the line is built up. Before the
value is inserted, the Macro before of the report field (if existent) is
executed. Due to this, the values of the current report variable can still be
changed in the macros.
If the condition for a group change is
fulfilled at the beginning of a data block, the group change block will be
printed before the data block.
Note: Only at the end of the data block, that
is after all macros of the data block have been executed, can you find out if a
group change exists. The data block will then already be printed. Because of
this, the print lines are buffered program-internally. If a group change has
taken place, the values of the totals that have been changed by the already
worked-off data block will be reset, then the group change block will be
printed. After that, the lines of the data block stored in the buffer are
output and the ‘Subtotal’ and ‘Sum’ fields are actualised again.
At the end of the report the report ending
block (if existent) is printed. Finally the foot block (if existent) is
printed, like on every page.
Before one of the blocks ‘data block’, ‘group
change block’ or ‘ending block’ is printed respectively, the current page is
internally checked on whether there is enough space for the number of lines
planned for this block. If not, the foot block is printed first, then the page
counter is raised by 1, then the head block of the next page is printed and
only then the respective block is printed. With the instructions REPORT_DATABLOCKLENGTH, REPORT_GROUPBLOCKLENGTH and REPORT_ENDBLOCKLENGTH the specified number of lines of
the respective block can be changed in the report administration and in this
way a different form feed control can be established.
Commands for report control
In the programming language of the Ebus-J a
whole string of special commands is available for individually controlling the
report print.
|
The current report line is not printed;
printing continues at the next line of the current block. If the current
report line is the last line of the current block printing will continue at
the next block. |
|
|
REPLINE <STRING-EXPRESSION> |
A line with the content of
<STRING-EXPRESSION> is printed before the current line. |
|
An empty line is printed before the current
line. (Like REPLINE "") |
|
|
The current report field is not printed;
printing continues at the next report field. In the print line blanks appear
instead of the field. |
|
|
The current block is cancelled. Printing
continues at the first line of the next block. In the foot block as many
blanks as there are number of lines in the block are printed. (In this way
the beginning of the next page will not be shifted.) |
|
|
This command is only effective in the data
block. After the current line has been printed, not the next line but the
current line is printed again. This is repeated as many times as the command
REPEATLINE is executed in a macro of the current line. |
The switch ENABLE
/ DISABLE LPGDI controls whether the
report is printed graphically or non-graphically (character mode).
With graphic print (ENABLE
LPGDI) any output of control characters for the form feed is not necessary.
With the non-graphic print (DISABLE LPGDI) as many lines are printed per page
as specified under report length in the report
specification. However, no
CHR$(12) is sent to the printer. If the report length does not
match with the number of lines that the printer can print on one page, the
report print will be shifted from the 2nd page on. If the form feed
shall be controlled by CHR$(12), the following actions must be taken:
In the first line of the head block a macro of
the following content is to be specified:
IF
PAGE > 1
THEN LPRINT CHR$(12);
ENDIF
From the 2nd page on the form feed for the
previous page is created in this way. The form feed for the last page is
created after the report has been called.
REPORT
#100
LPRINT CHR$(12);
With the graphic print these instructions
LPRINT CHR$(12); are ignored. The Ebus program detects that a form feed has
already been created internally.

Report Number: Every
report is uniquely identified by its report number. The report number can only
be assigned when the report is newly created, it cannot be changed anymore
afterwards.
Short Description: The short description is to inform only.
Index File: If
a name of an Index File is specified, the report will start in the Index File
at the position defined by the key fields. For every data record that has been
read the data block is printed once. This procedure is repeated until either
the end of the Index File is reached or the instruction ENDREP is executed in a
macro.
Key:
Specifies the key by which the Index File is read.
Report Length (Lines): Number of print lines per page.
Report Width (Columns): Number of print columns per line.
Number of Header Lines: Size of the header block. The header block is always printed at the same
position at the top of every page.
Number of Foot Lines: Size of the foot block. The foot block is always printed at the same
position at the top of every page.
Number of Lines for Data Block: Size of the data block. The data block is the repeating part of a
report, which is e.g. printed once for every set of Index File data that has
been read.
Number of Lines for Group Change Block: Size of the group change block. If a group change takes place, the
group change block will be printed.
Number of Lines for Ending Block: Size of the ending block. The ending block is printed at the end of the
report after the last group change block. This block can be used for printing
sum totals or concluding texts.
Button 'OK':
The report parameters are saved and the report editor is started.
Button 'Cancel':
Processing is stopped. Changes are not saved.