finacle training

62
www.accelfrontline.in Finacle Training Maha Report Writer

Upload: mason-cook

Post on 31-Dec-2015

639 views

Category:

Documents


52 download

DESCRIPTION

Finacle Training. Maha Report Writer. MahaReport. Mahareport. This is a tool for formating and generating reports This is a generic tool and is not specific to Finacle. Like any other reporting utility, mrt has it own syntax and the same is covered in detail here. ... Mahareport. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Finacle Training

www.accelfrontline.in

Finacle Training

Maha Report Writer

Page 2: Finacle Training

www.accelfrontline.in

MahaReport

Page 3: Finacle Training

www.accelfrontline.in

Mahareport• This is a tool for formating and generating

reports• This is a generic tool and is not specific to

Finacle. • Like any other reporting utility, mrt has it

own syntax and the same is covered in detail here.

Page 4: Finacle Training

www.accelfrontline.in

... Mahareport

GENERATE THE SPOOL FILE

CREATE MRT

EXECUTE THE MENU OPTION PRTMR

Page 5: Finacle Training

www.accelfrontline.in

... Mahareport• Spool file contains the input data.• The data fields are separated by a | (pipe)

character.• The report format is specified in the mrt file• The report can be generated through the

menu option PRTMR• From within Finacle, the exe mrbx4004

can be used to generate a report through mrt

Page 6: Finacle Training

www.accelfrontline.in

Data file(Spool file)• The data file (spool file) should have an

extension of ‘dat’. (eg. Test.dat, ptw.dat, etc.).

• This file contains the data in several lines.• Each line contains values of several fields,

each field separated by a pipe character• If the value of any field is null, we put two

pipe character without any value in between

Page 7: Finacle Training

www.accelfrontline.in

...Data file(Spool file)• The number of fields in each line is fixed

(as specified in the record layout section of the template file)

• There can be any number of lines in the spool file

• The spool file is normally generated by the Finacle code. However, it can be generated by other means also.

Page 8: Finacle Training

www.accelfrontline.in

Sections in a Mahareport template file

• The template (format) file is one where the user can specify the format in which the report has to be generated

• This file should have an extension of mrt (eg. test.mrt, pte.mrt, etc.)

• There are several sections in the template file.

Page 9: Finacle Training

www.accelfrontline.in

Sections in a Mahareport template file

• The following are the various sections– RECORDLAYOUT– LOCALVARIABLES– GROUPANDSORT– REPOSITORY– MASSAGERECORD– IGNORERECORD– ONEVERYRECORD

Page 10: Finacle Training

www.accelfrontline.in

... Sections in a Mahareport template file

– PAGEFORMAT– ONSTARTOFREPORT– PAGEHEADER– PAGEFOOTER– ONENDOFREPORT– BEFOREBREAKOF– AFTERBREAKOF– PROCEDURE– FIELDDUMP

Page 11: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• RECORDLAYOUT Section– This is a mandatory section– It contains the name and order of the fields

specified in the spool file– The fields are listed one below the other– Each line in this section contains the field

name and its type– The fields can be either ‘string’ type or

‘number’ type

Page 12: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

– These fields can be referred later in the mrt file by the name specified in this section

– If the same spool file is being used by more than one template file, a separate header file can be created with all the fields listed exactly as it is done in the record layout section

– This header (with extension mri) can be included in the record layout section.

Page 13: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

– Example• Suppose the input-file (ASCII file) contains the

following details:1000|GLSUBHEAD|SBGCA||20|25465.45|0|Y|N|N

1020|GLSUBHEAD|SBGCA||25|0|45,000.00|Y|N|Y

• The record layout section will be

Page 14: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

RECORDLAYOUT rptCode stringTypecodeDesc stringTypecodeDesc1 stringTypecodeDesc2 stringTypenoOfAccounts numberTypeoutStandingAmt numberTypeFXoutStandingAmt numberTypefoundFlg stringTypedescTypeFlg stringType

fxFlg stringType

Page 15: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• LOCLVARIABLES section

– This is a mandatory section– All the local variables will be declared here– This section name must appear in the spec-

file even if no local variables are required for processing.

– The variables can be of two types, ‘stringType’ or ‘numberType’

Page 16: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• Example

You can define some local variables as follows:

LOCALVARIABLES

Page_tot_printed stringType

total_pages numberType

Page 17: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• GROUPANDSORT Section

– This is a mandatory section. However, nothing needs to be specified in this section if no grouping and sorting is required. (That is, the section heading should always be present even if no grouping or sorting is required)

– The sort field and sort order can be specified in this section

Page 18: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

– The sort orders supported are•ascending•descending•already sorted

– Example

GROUPANDSORT

rptcode ascending

The report will be sorted in the ascending order of the rptcode (report code) field.

Page 19: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• REPOSITORY Section– This is an optional section

– Here, the variables to be accessed from a repository can be specified.

– You can define more than one repository in this section

– The variables can either be only a ‘stringType’ or a ‘numberType’

– Reading from and writing into repositories is an activity that is transparent to the user and happens at the very beginning and end, respectively

Page 20: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• example BankRepos.rip is a Unix file in which the following variables have been defined:

REPOSITORY bankRepos.rip ReadOnly

bankName stringType

branchName stringType

uniformBrCode stringType

branchDistrict stringType

branchState stringType

Page 21: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• MASSAGERECORD Section– This is an optional section– Here the action to be performed on any field

value can be specified– The operations specified here will be

executed only once on every record– This takes precedence over

IGNORERECORD and ONEVERYRECORD sections

Page 22: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• Example

MASSAGERECORD

set outStandingAmt = roundoff outStandingAmt N 100

– Before the IGNORERECORD or ONEVERYRECORD sections are read, the variable outStandingAmt is rounded off to the nearest 100

Page 23: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• IGNORERECORD Section– This is an optional section– The syntax is

if ( condition)– If the condition evaluates to TRUE, such

records are ignored and the next record is picked up

Page 24: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

•Exampleif (outStandingAmt = 0) and (FXoutStandingAmt = 0)

The above statement indicates that if variables outStandingAmt and FXoutStandingAmt have a value of zero, such records should be ignored.

Page 25: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• ONEVERYRECORD Section– This is an optional section, which is executed

once for each input record. This section also contains valid Action Statements

Page 26: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• PAGEFORMAT Section– This is an optional section where you can

specify the page layout details like number of lines in a page, margin size etc.

– The following page format setting can be done in this section LinesperPage (number of lines in a page including

the header lines, footer lines, top and bottom margins)

Page 27: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

PageHeaderLines (number of lines used for the Page Header)

PageFooterLines (number of lines used for the Page Footer)

TopMargin (number of lines to be left blank before the first line of the header is printed)

BottomMargin (number of lines to be left blank after the last line of the footer is printed)

noPageFeed (used to suppress page feeds in case you wish to use the output for further processing)

Page 28: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

columnsperLine (usually the number of columns may be upto 256)

LeftMargin (number of columns to be left blank on the left side of the page)

RightMargin (number of columns to be left blank on the right side of the page)

ignoreBlankRecord (used to ignore all blank records available in an input file)

Page 29: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

– ExamplewidowOrphanLines 3LinesPerPage 64LeftMargin 2rightMargin 2Topmargin 2BottomMargin 2columnsPerLine 132pageHeaderLines 5pageFooterLines 2

Page 30: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• ONSTARTOFREPORT Section– This section is optional and will be executed

only once at the beginning of the formatting process

– You can specify any valid action statements to carry out your requirements

– When the formatting process begins, only the repository variables are available. Variables defined in other sections cannot be used

Page 31: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• Variables defined in other sections cannot be used

• First record is not available at the time of executing onstartofreport section

• No header and footer will be printed while this section is being processed

• The repository variables are usually used to print the criteria on the first page of the report

Page 32: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• Example

ONSTARTOFREPORT

execute printCrit

print bankName column 10

print branchName column 60

nextline

print divName column 10

print dpCode column 60

Page 33: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• PAGEHEADER Section– This section is optional and will be called

whenever there is a PageBreak or a NextPage

– In this section, you can specify any valid Action statements to print headers at the top of the page

Example

PAGEHEADER

execute pageHeader

Page 34: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• PAGEFOOTER Section– This section is optional and can be called

whenever there is a PageBreak or a NextPage

– In this section, you can specify any valid Action statements to print footers at the bottom of the page

Example

PAGEFOOTER

execute pageFooter

Page 35: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• ONENDOFREPORT Section– This section is optional and will be executed

only once at the end of the formatting process– Any valid action statements to carry out the

requirements can be specified here – No header and footer will be printed while this

section is being processed

Page 36: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

Example

ONENDOFREPORTnextlineprint "Place : "nextlineprint "Date:"nextlinenextlineprint "Prepared By" column 28print "Checked By" column 50

print "Manager/Sr.Manager" column 70

Page 37: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• BEFOREBREAKOF Section–This is an optional section in which you can

specify valid Action statements–The syntax is

BEFOREBREAKOF varnameWhere ‘varname’ is a variable or a field that has been defined in the

GROUPANDSORT and RECORDLAYOUT sections

Page 38: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

Example

BEFOREBREAKOF intRate

separatorLine

Before breaking the group intRate the separatorLine will be printed

Page 39: Finacle Training

www.accelfrontline.in

...Sections in a Mahareport template file

• AFTERBREAKOF Section– This is an optional section in which you can

specify valid Action statements, similar to the BEFOREBREAKOF section

Example

AFTERBREAKOF intRate

print "Totals for IntRate "

print groupCount intRate column 30

print groupSum balance column 55

nextline

Page 40: Finacle Training

www.accelfrontline.in

Action Statements• Print

– This statement is used for printing the value of a specific variable. The syntax is:

– print [ modifier] varname [column ccc] [[size sss [precision p]] | [format “##,###.##$$”]] [ center| rightjustify|leftjustify] [fillAscii value ] [autoComma]

Page 41: Finacle Training

www.accelfrontline.in

...Action Statements• Set

– The set statement is used to set the value of a variable/field. The syntax isset varname = expression

Where expression is a valid arithmetic combination of variable names, function return values and constants.

– Example

set pageNumber=1 (sets the value of the variable ‘pageNumber’ to 1)

Page 42: Finacle Training

www.accelfrontline.in

...Action Statements• Display

– The display statement is used to display values on the screen when the report is being processed.

– The syntax isdisplay varname| string constant | number

constant| “\n”

(\n is used as linefeed here)

Page 43: Finacle Training

www.accelfrontline.in

...Action Statements• Execute

– The execute statement is used to invoke a procedure. The syntax is

execute procedure name

– Exampleif (rptCode = "1100")begin

execute check_value end

Page 44: Finacle Training

www.accelfrontline.in

...Action Statements• Begin ...... End

– The begin...end statements are used to mark the beginning and end of a block of Action Statements. These statements can be used with if...else actions to denote that a block of statements should be executed conditionally.

Page 45: Finacle Training

www.accelfrontline.in

...Action Statements– Example

PROCEDURE printReportHdr

begin

print bankName column 35

print " "

print branchName

nextline

nextline

execute printReportName

nextLine

end

Page 46: Finacle Training

www.accelfrontline.in

...Action Statements• If .... Else

The If...Else statements are used to conditionally execute a set of action statements. The syntax is

if expression

Block of code

else

block of code

Page 47: Finacle Training

www.accelfrontline.in

...Action Statements• Example

if pr_station = "N"

begin

print "Date Stamp" column 53

print "Manager" column 76

end

Page 48: Finacle Training

www.accelfrontline.in

...Action Statements• NextPage

– This statement is used when you want to skip a page while printing the report. When this action is used, the pageheader and pagefooter sections will be automatically invoked.

• NextLine– This statement advances the report by one line. – This should be used after every print statement

because the print action statement does not automatically move on to the next line

Page 49: Finacle Training

www.accelfrontline.in

...Action Statements• NextLineIfNotBlank

– This statement is similar to NextLine except that a line will be skipped only if something has not been printed on that line.

• DontFlushAfterSection– When any section ends, the NextLine action

statement is automatically invoked. To prevent this, you can use the DontFlushAfterSection statement. This is applicable only to section containing the DontFlushAfterSection statement.

Page 50: Finacle Training

www.accelfrontline.in

...Action Statements• SeparatorLine

– This action statement prints the ‘-’ character on an entire line for a length which is columnsperpage minus the sum of leftmargin and rightmargin

Page 51: Finacle Training

www.accelfrontline.in

...Action Statements• Exit

– This statement stops the execution of the report. It updates the corresponding repositories and exits the report.

Page 52: Finacle Training

www.accelfrontline.in

System Variables• Certain variables are reserved by the

system for specific purposes. These values cannot be changed during processing

Page 53: Finacle Training

www.accelfrontline.in

...System Variables• Today

– Current date & time in dd/mm/yyyy hh:mi:ss format

• PageNumber– The page number is incremented whenever

the end of the page is reached. You have the provision to REINITIALISE this variable during processing.

Page 54: Finacle Training

www.accelfrontline.in

...System Variables• lineNumber

– The line number is incremented whenever the nextline is executed

• LinesleftonPage– The number of lines that can still be printed on

the page (excluding footer lines)

Page 55: Finacle Training

www.accelfrontline.in

Statistical Functions• GroupSum

– The total value of a group

• GroupAverage– The average value of a group

• GroupCount– The total number of records in a group

• GroupMin– The minimum value in a group

Page 56: Finacle Training

www.accelfrontline.in

...Statistical Functions• GroupMax

– The maximum value in a group

• PageSum– The total value of a page

• PageAverage– The average value of a page

• PageCount– The count for a page (page number)

Page 57: Finacle Training

www.accelfrontline.in

...Statistical Functions• PageMin

– The minimum value in a page

• PageMax– The maximum value in a page

• TotalSum– The total value of a column

Page 58: Finacle Training

www.accelfrontline.in

...Statistical Functions• TotalAverage

– The average value of a column

• TotalCount– The count for a column (column number)

• TotalMin– The minimum value in a column

• TotalMax– The maximum value in a column

Page 59: Finacle Training

www.accelfrontline.in

Operators• The operators supported are:

– Arithmetic operators+, -, *, /. – Conditional Operators = , > ,<,>=,<=,!=.

• The standard precedence rules are followed. Parentheses can be used to force a different precedence.

Page 60: Finacle Training

www.accelfrontline.in

Other Functions• Function calls are supported by

Mahareport but are limited to library functions (no user-defined functions are available). The syntax is as follows:– set fld = function [Parameters]

Page 61: Finacle Training

www.accelfrontline.in

…Other Functions• The library functions that are supported

are– substr– roundoff– foundInString– numToStr– strToNum– rpad– lpad

Page 62: Finacle Training

www.accelfrontline.in

…Other Functions– rtrim– ltrim – numToWords– strLen

– splitString