Multiple Reports
Multiple Reports
Multiple Reports
This Is used to generate multiple outputs from the same data source.
Commands for multiple reports:
- DECLARE-LAYOUT
- DECLARE- REPORT
- FOR-REPORT
- USE-REPORT
DECLARE-LAYOUT
This is used to define the different output formats generated using the multiple
reports.
This is used in Begin-Setup section.
Based on number of outputs generated, that many number of DECLARE-
LAYOUT commands must be written in the Begin-Setup section.
Syntax:
DECLARE-LAYOUT <Layout name>
Other commands
END-DECLARE
Example:
BEGIN-SETUP
DECLARE-LAYOUT EMPDET
#INCLUDE ‘setup02.sqc’
END-DECLARE
DECLARE-LAYOUT PAYSLIP
#INCLUDE ‘setup01.sqc’
END-DECLARE
DECLARE-LAYOUT EMPTAB
END-DECLARE
END-SETUP
DECLARE-REPORT:
Example:
BEGIN-SETUP
DECLARE-REPORT EMPDET
LAYOUT= ‘EMPLDET’
END-DECLARE
DECLARE-REPORT PAYSLIP
LAYOUT= ‘PAYSLIP’
END-DECLARE
DECLARE-REPORT EMPTAB
LAYOUT= ‘EMPTAB’
END-DECLARE
END-SETUP
FOR-REPORT:
This is used to assign different heading and footing sections to different
reports.
This is used in heading and footing sections.
Syntax:
BEGIN-HEADING/ FOOTING # FOR-REPORT <report name>
PRINT commands
END-HEADING/ FOOTING
Example:
USE-REPORT
Example:
BEGIN-PROCEDURE PRINTING
USE-REPORT=’EMPLDET’
PRINT &EMPLID (+1, 1)
PRINT &NAME ( , 10)
PRINT &MONTHLY_RT ( , 40)
PRINT &HIRE_DT ( , 55)
PRINT &COUNTRY ( , 70)
USE-REPORT=’PAYSLIP ‘
PRINT ‘EMPLID : (1, 1)
PRINT ‘NAME : (3, 1)
PRINT ‘MNTHLY_RT : (5, 1)
PRINT &EMPLID (1 , 40)
PRINT &NAME ( 3, 40)
PRINT &MNTHLY_RT (5, 40)
NEW-PAGE
USE-REPORT=’EMPTAB’
PRINT &EMPLID (+1, 1)
PRINT &NAME ( ,10)
PRINT &AGE ( ,50)
END-PROCEDURE