Download presentation
Presentation is loading. Please wait.
1
www.accelfrontline.in Finacle Training Maha Report Writer
2
www.accelfrontline.in MahaReport
3
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.
4
www.accelfrontline.in... Mahareport GENERATE THE SPOOL FILE CREATE MRT EXECUTE THE MENU OPTION PRTMR
5
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
6
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
7
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.
8
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.
9
www.accelfrontline.in Sections in a Mahareport template file The following are the various sections –RECORDLAYOUT –LOCALVARIABLES –GROUPANDSORT –REPOSITORY –MASSAGERECORD –IGNORERECORD –ONEVERYRECORD
10
www.accelfrontline.in... Sections in a Mahareport template file –PAGEFORMAT –ONSTARTOFREPORT –PAGEHEADER –PAGEFOOTER –ONENDOFREPORT –BEFOREBREAKOF –AFTERBREAKOF –PROCEDURE –FIELDDUMP
11
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
12
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.
13
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
14
www.accelfrontline.in...Sections in a Mahareport template file RECORDLAYOUT rptCode stringType codeDescstringType codeDesc1stringType codeDesc2stringType noOfAccountsnumberType outStandingAmt numberType FXoutStandingAmtnumberType foundFlgstringType descTypeFlgstringType fxFlgstringType
15
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’
16
www.accelfrontline.in...Sections in a Mahareport template file Example You can define some local variables as follows: LOCALVARIABLES Page_tot_printedstringType total_pagesnumberType
17
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
18
www.accelfrontline.in...Sections in a Mahareport template file –The sort orders supported are ascending descending already sorted –Example GROUPANDSORT rptcodeascending The report will be sorted in the ascending order of the rptcode (report code) field.
19
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
20
www.accelfrontline.in...Sections in a Mahareport template file example BankRepos.rip is a Unix file in which the following variables have been defined: REPOSITORYbankRepos.ripReadOnly bankNamestringType branchNamestringType uniformBrCodestringType branchDistrictstringType branchStatestringType
21
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
22
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
23
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
24
www.accelfrontline.in...Sections in a Mahareport template file Example if (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.
25
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
26
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)
27
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)
28
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)
29
www.accelfrontline.in...Sections in a Mahareport template file –Example widowOrphanLines 3 LinesPerPage 64 LeftMargin 2 rightMargin 2 Topmargin 2 BottomMargin 2 columnsPerLine 132 pageHeaderLines 5 pageFooterLines 2
30
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
31
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
32
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
33
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
34
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
35
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
36
www.accelfrontline.in...Sections in a Mahareport template file Example ONENDOFREPORT nextline print "Place : " nextline print "Date:" nextline print "Prepared By" column 28 print "Checked By" column 50 print "Manager/Sr.Manager" column 70
37
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 varname Where ‘varname’ is a variable or a field that has been defined in the GROUPANDSORT and RECORDLAYOUT sections
38
www.accelfrontline.in...Sections in a Mahareport template file Example BEFOREBREAKOF intRate separatorLine Before breaking the group intRate the separatorLine will be printed
39
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
40
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]
41
www.accelfrontline.in...Action Statements Set –The set statement is used to set the value of a variable/field. The syntax is set 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)
42
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 is display varname| string constant | number constant| “\n” (\n is used as linefeed here)
43
www.accelfrontline.in...Action Statements Execute –The execute statement is used to invoke a procedure. The syntax is execute procedure name –Example if (rptCode = "1100") begin execute check_value end
44
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.
45
www.accelfrontline.in...Action Statements –Example PROCEDURE printReportHdr begin print bankName column 35 print " " print branchName nextline execute printReportName nextLine end
46
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
47
www.accelfrontline.in...Action Statements Example if pr_station = "N" begin print "Date Stamp" column 53 print "Manager" column 76 end
48
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
49
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.
50
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
51
www.accelfrontline.in...Action Statements Exit –This statement stops the execution of the report. It updates the corresponding repositories and exits the report.
52
www.accelfrontline.in System Variables Certain variables are reserved by the system for specific purposes. These values cannot be changed during processing
53
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.
54
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)
55
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
56
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)
57
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
58
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
59
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.
60
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]
61
www.accelfrontline.in …Other Functions The library functions that are supported are –substr –roundoff –foundInString –numToStr –strToNum –rpad –lpad
62
www.accelfrontline.in …Other Functions –rtrim –ltrim –numToWords –strLen –splitString
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.