0% found this document useful (0 votes)
14 views10 pages

Report Creation Through Programming

Uploaded by

Krishna Tejap6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views10 pages

Report Creation Through Programming

Uploaded by

Krishna Tejap6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 10

REPORT GENERATION THROUGH

PROGRAMMING

1
REPORT GENERATION THROUGH PROGRAM

• Step 1: Write a subroutine for E.g.. TEST.RPT and Compile.

• Step 2: Create a PGM.FILE with below details

TYPE = M
ADDITIONAL.INFO = .GUI
PRODUCT = EB

2
REPORT GENERATION THROUGH PROGRAM

Step 3: Create a REPORT.CONTROL record with id as specified in the routine.

GB.DESCRIPTION : TEST REPORT

GB.SHORT DESC : TEST.RPT

FORM.NAME : HOLD

MOCROFICHE.OUTPUT : N

Commit and authorise the record.

3
REPORT GENERATION THROUGH PROGRAM

STEP 4: Run the report from the T24 command line by entering the name of the
report

STEP 5: In T24 command prompt type HOLOD.CONTROL OR HC L L

Then again

REPORT.NAME EQ REPORT.ID
Press enter key and F5.
VERIFY the report.

STEP 6: The report will store in &HOLD&.

To view the report in Classic:


JED &HOLD& SPOOLENTRY ID

4
EXAMPLE:

GENERATE A REPORT TO PRINT THE CUSTOMER ID, CUSTOMER


NAME, STREET AND NATIONALITY OF CUSTOMER APPLICATION:

SUBROUTINE REPORT.RTN
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_F.CUSTOMER

GOSUB INITIALISATION
GOSUB PRINT.HEADER
GOSUB SELECT.REC
GOSUB PRINT.CLOSE

RETURN

INITIALISATION:

REPORT.ID = "REPORT.RTN"

CALL PRINTER.ON(REPORT.ID,0)

FN.CUSTOMER = 'F.CUSTOMER‘
F.CUSTOMER = ''
CALL OPF(FN.CUSTOMER,F.CUSTOMER)
5
RETURN
EXAMPLE: (cont..)
PRINT.HEADER:

PR.HD = SPACE(25):FMT("CUSTOMER DETAILS","30L")


PR.SUB.HD = FMT("ID", "7L"):SPACE(2)
PR.SUB.HD := FMT("NAME", "35L"):SPACE(3)
PR.SUB.HD := FMT("STREET", "35L"):SPACE(3)
PR.SUB.HD := FMT("NATIONALITY", "5L"):SPACE(3)
HEADING PR.HD
PRINT STR("-",78)
PRINT PR.SUB.HD
PRINT STR("-",78)
RETURN

SELECT.REC:

Y.SEL.CMD = 'SELECT ': FN.CUSTOMER : ' WITH TARGET EQ 999'


CALL EB.READLIST(Y.SEL.CMD,Y.SEL.LIST,'',Y.SEL.CNT,Y.ERROR)
LOOP
REMOVE Y.CUS.ID FROM Y.SEL.LIST SETTING Y.POS[H[J046 WHILE Y.CUS.ID:Y.POS

CALL F.READ(FN.CUSTOMER,Y.CUS.ID,R.CUSTOMER,F.CUSTOMER,Y.ERROR)

IF R.CUSTOMER THEN
Y.ID = Y.CUS.ID
Y.NAME = R.CUSTOMER<EB.CUS.NAME.1>
Y.STREET = R.CUSTOMER<EB.CUS.STREET>
Y.NATIONALITY = R.CUSTOMER<EB.CUS.NATIONALITY>
GOSUB PRINT.RECORD
END
REPEAT 6
RETURN
EXAMPLE: (cont..)

PRINT.RECORD:
PR.LN = FMT(Y.ID, "7L"):SPACE(2)
PR.LN:= FMT(Y.NAME, "35L"):SPACE(2)
PR.LN:= FMT(Y.STREET, "35L"):SPACE(2)
PR.LN:= FMT(Y.NATIONALITY, "5L"):SPACE(2)
PRINT PR.LN
RETURN

PRINT.CLOSE:

PRINT SPACE(15):'--------------------END OF REPORT--------------------


CALL PRINTER.OFF
CALL PRINTER.CLOSE(REPORT.ID,0,'')
RETURN
END

7
WORKSHOP
Write a program to generate a report which gives the Customer Name ,
Customer Code from the Customer Application and gives working
balance information (> 0) for that Customer from the Account
application grouping the Working Balance by Currency.

8
WORKSHOP
Generate a report which retrieves all the customer accounts with Actual
Online Balance greater than zero and displays the Account No,
Customer Code, Account Title and Open Actual Balance.

9
WORKSHOP
Generate a report to find total of working balance by currency. Display fields
are customer id, customer name, account number, currency, working balance
grouped by customer.

Customer Code <xxxxx> <CustomerName>


------------------------------ ----------------------- ------------------------------
Account Number Currency Balance
<xxxx> <CCY1> <xxxxxxxxx.xx>
<xxxx> <CCY1> <xxxxxxxxx.xx>
Total <xxxxxxxxx.xx>
<xxxxx> <CCY2> <xxxxxxxxx.xx>
<xxxxx> <CCY2> <xxxxxxxxx.xx>
Total <xxxxxxxxx.xx>

10

You might also like