Type search words and press enter
TallyPrime now automatically fetches the distance between origin and destination pincodes, and prints it in the e-Way Bill. You no longer have to manually enter this distance. Download TallyPrime Release 5.1 now!
https://help.tallysolutions.com/docs/td9rel54/tdlreference/reports_printing_and_validation.htm

Reports, Printing and Validation Controls

On this page

Reports

Displaying the exploded part

Designing hierarchical reports

Designing auto-column reports

Designing multi-column reports

Designing auto auto-column reports

Printing

Printing techniques

Frequently used attributes and functions

Validation and controls

In previous lesson, the significance and usage of User Defined Fields was explained. The classification and creation of UDFs was also discussed. This lesson is dedicated to Report creation and printing. The types of reports and the different ways of printing them will be explained in detail.

Watch this video to know about designing reports and customizing invoice

Watch the below video for designing different types of reports such as tabular report, hierarchical report and column based reports

Watch the below video for printing reports and invoices in different formats

Reports

In Tally.ERP 9, financial statements are generated as Reports, based on the vouchers entered till date. Balance Sheet, Profit & Loss A/c, Trial Balance, etc., are some default Reports in Tally.

Normally, a business requires Reports in any of the following formats:

Tabular Report: A Report with fixed number columns, which can be configured.

Hierarchical Report: A Report designed in successive levels or layers.

Column-Based Reports: A Report with multiple columns. Tally.ERP 9 caters to generating all these types of Reports. Tabular Reports

They have the simplest format of all the Report formats. A typical Tabular report has the following components:

Report Title: It contains the Name of the Report, the Title for each column, the Day/Period for which a Report is generated, etc.

Report Details: It contains the actual information.

Report Total: It contains the Total of the respective columns.

A typical Tabular Report has a fixed number of columns and is interactive, i.e., an end user can change its appearance. Day Book, Stock Summary, Trial Balance, Group Summary, etc., are some default Tabular Reports in Tally. The Tabular Report ‘Stock Summary’ is shown in Fig. 9.1

Designing a Tabular Report

A typical Tabular Report will have a Title Line, a Details Line, and an optional Total Line. The Details Line will be repeated over the objects of a Collection. A Tabular Report can be made Interactive by adding the following features:

Adding Buttons to change the period, to change the contents of the Report, etc. (As discussed in lesson 5: Variables, Buttons, Keys).

Adding explosions to the lines.

Figure_9.1_Stock_Summary.jpg

Displaying the Exploded Part

Tally.ERP 9 allows the user to display additional information about the current line object, when the key combination SHIFT + Enter is pressed. This functionality is called as ‘explosion’ in Tally. Line attributes Explode and Indent, and the function $$KeyExplode, are used for the same.

Attribute - Explode

The attribute ‘Explode’ refers to an attribute of the line, which is used to take the current data from the Line Object. A Part is displayed after the process of explosion is complete.

Syntax

Explode : <Part Name> : <Logical Condition>

Where,

< Part Name > is the name of the Part which displays additional information about the Line object.

< Condition > if True, will result in an explosion.

Function - $$KeyExplode

$$KeyExplode function gives the current status of the keys Shift and Enter. This is used as a condition to check if the user has pressed the Shift+Enter Key combination.

Example 1: Sim p le T abular Report

Let us consider writing a simple Trial Balance.

[Part : My TB Part]

Lines : My TB Title, My TB Details

Repeat : My TB Details : My TB Groups

Scroll : Vertical

Figure_9.2_Simple_Trial_Balance_Report.jpg

Example 2: A Simple Interactive Tabular Report

A report showing all the Primary groups can be created and exploded by pressing Shift + Enter to view the sub groups. The ledgers can subsequently be viewed on the same screen with an indent for each level.The report is as shown in Figure 9.3

The following code snippet displays the exploded part:

[Line : My TB Details]

Fields       : My TB Name Field, My TB ParName Field

Right Fields : My TB Dr Amt Field, My TB Cr Amt Field

Explode      : My TB Group Explosion : $$IsGroup and $$KeyExplode

[Field : My TB Name Field]

Use       : Name Field

Set as    : $Name

Variable  : MyGroupName1

Figure_9.3_Simple_Interactive_Trial_Balance.jpg

Figure 9.3 Simple Interactive Tabular Report. The code for the exploded part is as follows:

[Part : My TB Group Explosion]

Lines  : My TB Details Explosion

Repeat : My TB Details Explosion : My TB GroupsLedgers

Scroll : Vertical

[Line : My TB Details Explosion]

Fields       : My TB Name Field, My TB ParName Field

Right Fields : My TB Dr Amt Field, My TB Cr Amt Field

Explode      : My TB Group Explosion : $$IsGroup and $$KeyExplode

Indent       : 2 * $$ExplodeLevel

Local        : Field : Default : Delete : Border

The Collection My TB GroupLedgers is a union of collections of Type ‘Group’ and ‘Ledger’, respectively.

[Collection : My TB GroupsLedgers]

Collection : My TB Groups, My TB Ledgers

The Variable MygroupName1 is used in Child Of attribute, under the collections ‘ My TB Groups ’ and ‘ My TB Ledgers ’.

[Collection : My TB Groups]

Type     : Group

Child Of : #MyGroupName1

[Collection : My TB Ledgers]

Type     : Ledger

Child Of : #MyGroupName1

When the user presses the Shift + Enter keys, then the exploded part shows the Sub-groups under the group in the current line, as shown in Figure 9.4.

Figure_9.4_Simple_Interactive_Tabular_Report.jpg

When the keys Shift + Enter are pressed by the user, one more exploded part shows the Ledgers under the current Sub-group, as shown in Figure 9.5.

Figure_9.5_Exploded_Tabular_Report.jpg

Hierarchical Report (Drill down Report)

A Tally application provides a simple way of navigating from one report to another, which is commonly referred to as a drill down. A Drill Down facility moves from one report to the other to give a detailed view based on the selection in the current report. A user can return to the first Report from the detailed view. A typical drill down in Tally.ERP 9 starts from the Report and reaches the Voucher Alteration screen.

Designing Hierarchical Reports

Hierarchical Reports can be designed by incorporating the following changes to a Tabular Report:

Variable attribute of Report definition

Child Of attribute of Collection definition

Display and Variable attributes of Field definitions

Variable Definition

Example

The following code snippet demonstrates the Drill down action, which is based on the Group Name displayed in the field. The Drill down action is achieved by specifying the two attributes ‘Variable’ and ‘Display’ at the field level.

[Field : My T B Name]

Width : 120 mms

Set as : $Name

Variable : GroupVar

Display : My Trial Balance : $$IsGroup

A Variable is defined as ‘Volatile’ and is associated at Report. The attribute ‘Variable’ of Report definition is used to associate the Variable with the report.

[Variable : Group Var]

Type : String

Default : ""

Volatile : Yes

[Report : My Trial Balance]

Form : My Trial Balance

Variable : GroupVar

The same Variable is used in the ‘Childof’ attribute of the ‘Collection’ definition. When a line is repeated over this collection in the report; when the user presses the Enter key, the Report being displayed will have the objects whose Parent Name is stored in the variable.

[Collection : My Collection]

Type     : Group

Child of : ## GroupVar

The following screen is displayed when the user selects the option from the Menu:

Figure_9.6_Trial_Balance_Report.jpg

When the key Enter is pressed by the user, the next screen displays the Sub Groups of the current Group as shown in Figure 9.7

Figure_9.7_Trial_Balance_-_Sub_group.jpg

Column Based Reports

The reports in which the number of columns added or deleted as per the user inputs are referred to as column-based reports. There are four types of column-based reports in Tally, namely Multi-Column Reports, Auto-Column Reports, Automatic Auto-Column Reports and Columnar Reports. All these types are explained with examples in this section.

Multi-Column Reports

In Multi-Column reports, a column is repeated based on the criteria specified by user. Trial Balance, Balance Sheet, Stock Summary, etc., are some default Reports in Tally.ERP 9 having Multi column feature. Normally, this feature is used to compare values across different periods.

Designing a Multi Column Report

In a Tabular Report, Lines are repeated over a collection. But in a multi-column Report, columns are repeated in addition to the repetition of the Lines over a Collection. Based on the user input, columns are repeated. The column Report is used to capture user inputs like Period, Company Name, Stock Valuation, etc., based on which columns are generated.

Following attributes are used at various components of a Report to incorporate the multi-column feature:

Attribute - Column Report

Attribute ‘Column Report’ of the ‘Report’ definition, facilitates the creation of multi-column reports.

Syntax

ColumnReport : <Report Name>

Where,

< Report Name > is the name of the report used to obtain user inputs from the options displayed.

Attribute - Repeat

Attribute ‘Column Report’ is associated with a variable, which in turn is specified in ‘Repeat’ attribute of ‘Report’ definition. Both attributes are specified in ‘Report’ definition to create a multi-column report.

Syntax

Repeat : Variable

Example: Incorporating Multi Column Feature to Trial Balance report

Step 1 : Using Column Report & Repeat attribute at the Report

By using the ‘Column Report’ & ‘Repeat’ attributes at the Report, “New Column”, “Alter Column” and “Delete Column” buttons will be automatically added to ‘MulCol TrialBalance’ Report.

[Report: MulCol Trial Balance]

ColumnReport : MyMultiColumns

Repeat       : SVCurrentCompany, SVFromDate, SVToDate

Figure_9.8_Multi_Column_Report.jpg

Step 2 : Modifying the System Variables in a multi-column Report

By clicking New Column button, ‘MyMultiColumns’ Report is displayed. In this Report, the user inputs are captured, which will be reflected in the System Variables.

[Field : My MultiFromDate]

Use : Uni Date Field

Modifies : SVFromDate

[Field : My MultiToDate]

Use : Uni Date Field

Modifies : SVToDate

[Field : My MultiCompany]

Use : Name Field

Modifies : SVCurrentCompany

Table : Company

Figure_9.9_Column_Details_for_Multi_Column_Report.jpg

Step 3: Repeating Columns over a Variable and Lines over Objects of a Collection

To repeat columns over a Variable, which is captured in ‘MyMultiColumns’ Report, following needs to be done at various components of the ‘MulCol Trial Balance’ Report.

1. Report Definition: Repeating over the values of system variable which is captured in MyMultiColumns Report

[Report : MulCol Trial Balance]

Repeat : SVCurrentCompany, SVFromDate, SVToDate

2 . Part Definition: Repeating Lines over objects of a Collection.

[Part : MulCol TB Details]

Lines : MulCol TB Details

BottomLines : MulCol TB Total

Repeat : MulCol TB Details : MulCol TB GroupLed

3. Line D e finition:- R e peating Field

[Line : MulCol TB Details]

Fields : MulCol TB Name Field, MulCol TB Amount Field

Repeat : MulCol TB Amount Field

Figure_9.10_Multi_Column_Report.jpg

Auto-Column Report

An Auto column report is one in which multiple columns are repeated by just one click of a button. Trial Balance, Balance Sheet, Stock Summary, etc., are some of the default Reports in Tally.ERP 9 which have an Auto column feature.

Designing an Auto-Column Report

Auto column Report is similar to a Multi column Report, except that here, a set of columns are repeated, instead of one. User input will decide the criteria on which the columns are repeated.

Example: Incorporating Auto Column Feature to Trial Balance report

Step 1 : Adding the Configuration Screen to the Form

The Button MyAutoButton is added to Form. Through this Button, the configuration Report ‘MyAutoColumns’ is arrived at through the Auto columns mode.

[Form : MulCol Trial Balance]

BottomButton : MyAutoButton,

[Button : MyAutoButton]

Key : Alt+N

Action : Auto Columns : MyAutoColumns

Title : $$LocaleString:"Auto Column"

Figure_9.11_Auto_Column_Reports.jpg

Step 2 : The Configuration Report ‘MultiAutoColumns’

1. In configuration Report, the user will be given options like ‘Days’,’ Monthly’, Yearly’, ‘Company’, etc., based on which the columns are repeated. In TDL, these options are external objects.

[Collection : MyAuto Columns]

Title  : $$LocaleString : "Column Details"

Object : MyCurrentCompany, MyQuarterly, MyMonthly, MyYearly, MyHalfYearly

Filter : Belongs

Format : $$Name, 15

;; ‘Belongs’ is a system formula which filters the objects

;; based on the value of the Methods ‘BelongsIf’ of all the objects

;; Function Name returns the Name of any given object

[Object : MyCurrentCompany]

Name      : $$LocaleString : "Company"

VarName   : "SVCurrentCompany"

CollName  : "List of Primary Companies"

BelongsIf : $$NumItems : ListOfPrimaryCompanies > 1

IsAgeWise : No

Periodicity : ""

;; Function $$NumItems returns the number of selected companies

;; ‘BelongsIf’ is a method of the object MyCurrentCompany, which

;; is used to control the display of the objects in the collection

[Object : MyQuarterly]

Name : $$LocaleString : "Quarterly"

VarName : "SVFromDate, SVToDate"

CollName : "Period Collection"

BelongsIf : "Yes"

IsAgeWise : No

Periodicity : "3 Month"

[Object : MyHalfYearly]

Name : $$LocaleString:"Half-Yearly"

VarName : "SVFromDate, SVToDate"

CollName : "Period Collection"

BelongsIf : "Yes"

IsAgeWise : No

Periodicity : "6 Month"

[Object : MyMonthly]

Name : $$LocaleString:"Monthly"

VarName : "SVFromDate, SVToDate"

CollName : "Period Collection"

BelongsIf : "Yes"

IsAgeWise : No

Periodicity : "Month"

[Object : MyYearly]

Name : $$LocaleString:"Yearly"

VarName : "SVFromDate, SVToDate"

CollName : "Period Collection"

BelongsIf : "Yes"

IsAgeWise : No

Periodicity : "Year"

Note: Columns can be repeated over any collection. They are not restricted only to a Period.

Figure_9.12_Auto_Repeat_Columns.jpg

2. When the user selects any one of the options, the system variables need to be modified so that, the columns can be generated in the parent Report on the basis of these values.

[Field : My SelectAuto]

Use : Short Name Field

Table : MyAutoColumns

Show Table : Always

[Field : My AutoColumns]

Use : Short Name Field Invisible : Yes

Set as : $$Table:MySelectAuto:$VarName

Set always : Yes

Skip : Yes

;; Function Table selects the Object Name from the previous Field My SelectAuto

;; and displays the corresponding method value of VarName

[Field : My CollName]

Use : Short Name Field

Invisible : Yes

Set as : $$Table:MySelectAuto:$CollName

Modifies : DSPRepeatCollection

Set always : Yes

Skip : Yes

;; We are modifying the value of the default variable DSPRepeatCollection by the value of the Method CollName from the selected Object DSPRepeatCollection is repeated in the Default Variables SVCurrentCompany, SVFromDate and SVToDate, which gets new values for each column

[Field : My StartPeriod]

Use : Short Date Field

Invisible : Yes

Set as : if $$IsEmpty:$$Table:MySelectAuto:$Periodicity then+

##SVFromDate else if $$Table:MySelectAuto:$Periodicity = "Day" then ##SVFromDate else +

$$LowValue:SVFromDate

Set always : Yes

Modifies : SVFromDate Skip : Yes

;; Value of Variable SVFromDate is set here based on the Periodicity Method.

;; $$LowValue is a Function that returns the beginning date of the Current Period

[Field : My EndPeriod]

Use : Short Date Field

Invisible : Yes

Set as    : if $$IsEmpty : $$Table:MySelectAuto:$Periodicity then ##SVToDate else if $$Table:MySelectAuto: +

$Periodicity = "Day" then $$MonthEnd:#DSPStartPeriod else $$HighValue:SVToDate

Set always : Yes

Modifies   : SVToDate

Skip       : Yes

;; Value of the Variable SVToDate is set here based on the Periodicity Method.

;; MonthEnd is a Function that gives the last day for a given month

[Field : My SetPeriodicity]

Use : Short Name Field

Invisible : Yes

Set as : if NOT $$IsEmpty:$$Table:MySelectAuto:$Periodicity then $$Table:MySelectAuto:$Periodicity else "Month"

Set always : Yes

Modifies : SVPeriodicity

3. The generated values are sent to the Parent Report by using the Form attribute ‘Output’.

[Form : MyAutoColumns]

No Confirm : Yes

Parts      : My AutoColumns

Output     : My AutoColumns

Step 3 : Repeating Columns over a Variable and Lines over Objects of a Collection

To repeat columns over a Variable which are captured in an Auto Columns Report, the following needs to be done at various components of the ‘MulCol Trial Balance’ Report.

1. Report Definition: This involves repeating the Values of a System Variable which is cap- tured in ‘MyMultiColumns’ Report.

[Report : MulCol Trial Balance]

Repeat : SVCurrentCompany, SVFromDate, SVToDate

2. Part Definition: This involves repeating Lines over the Objects of a Collection.

[Part: MulCol TB Details]

Lines : MulCol TB Details

BottomLines : MulCol TB Total

Repeat : MulCol TB Details : MulCol TB GroupLed

1 Line Definition: This involves repeating a Field.

[Line : MulCol TB Details]

Fields : MulCol TB Name Field, MulCol TB Amount Field

Repeat : MulCol TB Amount Field

Figure_9.13_Auto_Column_Report.jpg

Automatic Auto-Column Reports

There may be situations when the columns are required  ;automatically without the intervention of the user when the report is opened. The Attendance Sheet is an example of the Automatic autocolumn Report in Tally.ERP 9.

Designing an Automatic Auto Column Report

In order to design an Automatic Auto Column Report, the function $$SetAutoColumns, and the pre-defined variables DoSetAutocolumn and the DSPRepeatCollection are used.

The following points must be considered while creating the automatic auto-column reports:

1. The value of the variable DoSetAutoColumn must be set to YES.

2. The variable DSPRepeatCollection stores the Collection Name to be repeated.

3. The function $$SetAutoColumns accepts the name of a variable which is repeated over the value of variable ‘DSPRepeatCollection’.

4. The columns are displayed based on the values in the collection provided by variable ‘DSPRepeatCollection’.

Example

Consider the example of creating an auto-column for a Trial Balance. The same report can be modified to have automatic Columns for Multiple selected companies. As mentioned earlier, the following should be resorted to:

The variable DoSetAutoColumn must be set to Yes .

[Report : MulCol Trial Balance]

Set : DSPRepeatCollection : "List of Primary Companies"

The variable DSPRepeatCollection has to be set to “List of Primary Companies”

[Form : MulCol Trial Balance]

Option : Set Auto Option : $$SetAutoColumns:SVCurrentCompany

Add a dummy option in the ‘Form’ Definition such that the condition of the same is $$SetAutoColumns:SVCurrentCompany . The variable SVCurrentCompany will be repeated automatically as soon as you enter the report, provided multiple companies are loaded.

Also add the following lines to the Form Definition ‘MultiCol Trial Balance’

Option : Set Auto Option : $$SetAutoColumns : SVCurrentCompany

[!Form : Set Auto Option]

Multiple companies should be loaded for this program. Now, when the user selects the Menu Item, the following screen is displayed:

Figure_9.14_Displaying_Trial_Balance_for_two_different_companies.jpg

Columnar Report

All the Voucher Reports which contain Accounting Information (Ledger and/or Group Info) available in Vouchers, and can be displayed as Columns, are categorized as Columnar Reports. For example, Sales Register, Purchase Register, Journal Register, Ledger, etc., where the Voucher Registers can display multiple columns and respective values for each column, viz. the ledger, the parent of the ledger, etc., entered in the voucher, as opted by the user.

Note: These types of Reports also use the Auto Column concept for achieving disparate columns.

Stock Registers and Sales Registers are a classic example of Columnar Reports.

Printing

We have already understood the various types of reports and the techniques to generate them. An essential element of Reporting is printing. All the reports must be printable in one form or the other.

Printing Techniques : The techniques used for Printing are as follows:

Menu Action – Print/Print Collection

Menu Action Print or Print Collection enters the final Report in ‘Print’ mode.

Syntax

[Menu : <Menu Name>]

Add : Key Item:[Position] : <Display Item> : <Unique Key>: <ActionKeyword> : <Action Parameter>

;; where Action Keyword can be ‘Print’ or ‘Print Collection’ which triggers a list and displays the

;; final report based on user selection

Example

[#Menu : Printing Menu]

Add : Key Item : My Ledgers : L : Print Collection : Ledger Vouchers

Add : Key Item : My Day Book : D : Print : Day Book

Here, we are adding the Item ‘My Ledgers’, which has an action ‘Print Collection’ associated to it.

It displays a collection bearing the List of ledgers, which on user selection, enters the final report in ‘Print’ Mode. On accepting, it directly goes to the printer.

Button Action – Print Report

Another method of printing reports is by way of associating a Button with an action ‘Print Report’ at the ‘Form’ definition. Action ‘Print Report’ prints the current report by default. This action accepts Report Name as its parameter. If any report other than current needs to be printed, an additional parameter containing Report Name needs to be specified. The current report can pass the user selection to the printing report through a default collection called ‘Parameter Collection’.

Syntax

[Button : <Button Name>]

Action : <Print Report> [: Action Parameter]

Example

Consider a report displaying a list of employees, wherein the user selects the required employees for whom pay slips need to be printed. On clicking the ‘Print’ Button, the current report bearing the list of employees is not required. A new report printed for various pay slips allotted to the selected employees is needed.

[Button : Print Selected Pay slips]

;; Associate this button to the current report displaying the list of employees

Key : Alt + F11

Title : "Print Selected Pay slips"

;; Multiple Payslip Print Report will be printed on activation of this Button

;; The Report should be altered to include the in-built Collection ‘Parameter

;; Collection’ to print the user selection for the list of employees

Action : Print Report : Multi Pay Slip Print

Scope : Selected Lines

[#Report : Multi Pay Slip Print]

Collection : Parameter Collection

Here, the Button ‘Print Selected Pay slips’ is defined with the Action ‘Print Report’, which also has an action parameter, i.e., the Report Name to be printed. The scope of the Button is ‘Selected Lines’, which means that the final Report ‘Multi Pay Slip Print’ must contain only the selected Objects from the current Report. The user selection is passed to the new Report through a Collection ‘Parameter Collection’, which must be used in the destination Report ‘Multi Pay Slip Print’. So, the Report ‘Multi Pay Slip Print’ can be modified and added to the collection ‘Parameter Collection’.

Page Breaks

A Page Break is the point at which one page ends and another begins. Handling Page Breaks is important, as the current page should indicate continuation to the next page, while the next page must indicate that the current page is continued from the previous page. So, there must be a closing identifier, i.e., closing page break information and an opening identifier, i.e., opening page break information.

In other words, Page Breaks specify the headers and footers for every page, and are printed across multiple pages. Closing Page Break starts printing from the first page and prints on every page except the last page, e.g., Continued... to be printed at the bottom of each page. Opening Page Break starts printing from the second page till the last page. Closing Page Break is specified before Opening Page Break, since in any circumstance, closing page break is encountered first.

In TDL, Page Breaks can be handled vertically as well as horizontally .

Types of Page Breaks

Vertical Page Breaks

In cases where a report containing data cannot be printed in a single page, one needs to use vertical page breaks. Vertical Page Breaks can be specified at 2 levels, viz. Form and Part .

Form Level Page Break

Vertical Page Breaks can be specified at Form through the Form Attribute ‘Page Break’. It takes 2 parameters, viz. First Part for Closing Page Break and Second Part for Opening Page Break.

Syntax

[Form: <Form Name>]

Page Break : <Closing Part>, <Opening Part>

Example

Consider a Trial Balance report of a company, which requires the title and address of the Company in the first page and the grand total in the last page. In the pages between the first and the last page, the text Continued.... may be required at the end of each page, and the Company Name and Address at the beginning of each page.

[Form : My Trial Balance]

Page Break : Cl Page Break, Op Page Break

;; where both Cl Page Break and Op Page Break are Parts

[Part : Cl Page Break]

Lines : Cont Line

[Line : Cont Line]

Fields : Cont Field

Border : Full Thin Top

[Field : Cont Field]

Set As : “Continued…”

Full width : Yes

Align : Right

[Part : Op Page Break]

Parts : DSP OpCompanyName, DSP OpReportTitle

Vertical : Yes

In this example, Closing Page Break is defined to print Continued... at the end of every continued page. Opening Page Break is defined to print the Company Name and Report Title at the beginning of all the continuing pages. Since more than one part is used within Part definition, specify the alignment as ‘Vertical’, if required.

Part Level Page Breaks

Vertical Page Breaks can be specified at Part through the Part Attribute Page Break. This is generally used when the Page Totals are to be printed for each closing and opening pages.

It takes 2 parameters, viz.1st Line for Closing Page Break and 2nd Line for Opening Page Break.

Syntax

[Part : <Part Name>]

Page Break : <Closing Line>, <Opening Line>

Example

Consider a Trial Balance Report of a company, where we may require the running page totals to be printed at the end and beginning of each page.

[Part : My Trial Balance]

Page Break : Cl Page Break, Op Page Break

;; where both Cl Page Break and Op Page Break are Lines

[Line : Cl Page Break]

Use : Detail Line

Local : Field : Particulars Fld : Set As: “Carried Forward”

Local : Field : DrAmt Fld: Set As : $$Total:DrAmtFld

Local : Field : CrAmt Fld: Set As : $$Total:CrAmtFld

Local : Field : NetAmt Fld: Set As : $$Total:NetAmtFld

Border : Full Thin Top

[Line : Op Page Break]

Use : Cl Page Break

Local : Field : Particulars Fld : Set As : “Brought Forward”

Here, Line ‘Cl Page Break’ is defined to use the pre-defined ‘Detail Line’ and the relevant fields are modified locally to set the respective values. Similarly, the Line ‘Op Page Break’ is defined to use the above defined line ‘Cl Page Break’, which locally modifies only the field ‘Particulars Fld’.

Horizontal Page Breaks

Horizontal Page Breaks are used if the number of columns run into multiple pages.

Line Level Page Breaks

Horizontal page breaks can be specified at Line through Line Attribute ‘Page Break’. It is generally used to repeat a closing column at every closing page and opening column at every opening page. It takes 2 parameters, viz. 1st Field for Closing Page Break & 2nd for Opening Page Break.

Syntax

[Line : <Line Name>]

Page Break : <Closing Field>, <Opening Field>

Example

Consider a Columnar Sales Register Report of a company, where multiple columns are printed across pages. Some fixed columns are required in subsequent pages which makes it easy to map the columns in subsequent pages.

[#Line : DSP ColVchDetail]

Page Break : Cl Page Break, Op Page Break

;; where both Cl Page Break and Op Page Break are Fields

[Field : Cl Page Break]

[Field : Op Page Break]

Fields : DBC Fixed, VCH No

In this example, the Field Cl Page Break is defined as Empty, since no Closing Column or Field is required and Field Op Page Break is defined with further fields DBC Fixed and VCH No, which are available in default TDL.

Form Level Page Break

Part Level Page Break

Line Level Page Break

It is a Vertical Page Break

It is a Vertical Page Break

It is a Horizontal Page Break

Page Break attribute accepts Part Names as its value

Page Break attribute accepts Line Names as its value

Page Break attribute accepts Field Names as its value

Multiple Parts (parts within parts) can be printed both at closing and opening page breaks

Multiple lines (lines within lines) can be printed at both closing and opening page breaks

Multiple Fields (Fields within Fields) can be printed at both closing and opening page breaks

Form Level Page Breaks cannot handle running Page Totals

Running Page Totals can be handled with Part Level Page Break

Column Page Totals can be handled with Line Level Page Break

Frequently Used Attributes and Functions

Attributes

Line Level Attribute – Next Page

The ‘Next Page’ attribute specifies the cut off line that gets printed in the subsequent page. It accepts a logical formula as its parameter.

Syntax

[Line : <Line Name>]

Next Page : <Logical Formula>

Example

[Line : DSP Vch Explosion]

Next Page : (($$LineNumber = $$LastLineNumber) AND $$IsLastOfSet)

Attribute – Preprinted/PrePr i nted Border

The Attribute ‘Preprinted’ or ‘Preprinted Border’ can be specified at Part, Line and Field Definitions. These attributes work in conjunction with ‘preprinted/ plain’ button in the Print Configuration screen. When the Preprinted attribute is set to YES, the contents of the current Part, Line or Field will be left blank assuming the same to be pre-printed. When the ‘Preprinted Border’ attribute is set to YES, the borders used in the current Part, Line or Field will be assumed to be pre-printed.

Syntax

[Line : <Line Name>]

Preprinted : <Logical Value>

Example :

[Line : Company Name]

Preprinted : Yes

Functions

Functions - $$PageNo and $$PartNo

The $$ PageNo function returns the current Page Number while the $$ PartNo function returns the current Part Number of the page. These functions do not require any parameter and the return type for $$ PageNo is Number and $$ PartNo is String.

Syntax

$$PageNo

$$PartNo

Example

[Field : My PageNo]

Set as : “Page ” + $$String:$$PageNo + “ (“ + $$PartNo + “)”

Function - $$ I sLastOfSet

It is used to check if the current Form is the last Form being printed. It doesn’t require any parameter. It returns TRUE, if the current Form is the last Form being printed, else returns FALSE.

Syntax

$$IsLastOfSet

Example :

[Line : DSP Vch Explosion]

Next Page : (($$LineNumber = $$LastLineNumber) AND $$IsLastOfSet)

Function - $$DoEx p losionsfit

In the process of printing, if a line is exploded, then this function can be used to check whether the exploded part fits within the current page. This function also doesn’t require any parameter and returns its logical value. It returns its logical value as YES, if it is True.

Syntax

$$DoExplosionsFit

Example :

[Line : EXPSMP InvDetails]

NextPage : NOT $$DoExplosionsFit OR (($$LineNumber = $$LastLineNumber)

$$BalanceLines

It is used to check the balance number of lines in the repeated lines, including the exploded part lines present, in a given part. Scroll : Vertical must be specified at ‘Part’ definition in order to use this function. This function too does not require any parameter and returns a Numerical value.

Syntax

$$BalanceLines

Example

[Line : AccType Detail]

NextPage : ($$BalanceLine > 0) AND (($$BalanceLines < 5)

Here, if the Balance number of lines is between 0-5, remaining lines will be printed on next page.

Validation and Controls

Data validation and controls in Tally can be done at two levels, either at the Platform level or at the TDL level. TDL Programmers do not have control over any of the Platform level validations. TDL Programmers can only add validation and controls at the TDL Level. Let us understand some of the TDL Level validation and control mechanisms.

Field Level Attribute - Validate

This attribute checks if the given condition is satisfied. Unless the given condition for ‘Validate’ is satisfied, the user cannot move further, i.e., the cursor remains placed on the current field without moving to the subsequent field. It does not display any error message.

Syntax

Validate : <Logical Formula>

Example

[Field : CMP Name]

Use      : Name Field

Validate : NOT $$IsEmpty : $$Value

Storage  : Name

Style    : Large Bold

In this example:

1. The field CMP Name is a field in Default TDL which is used to create/ alter a Company.

2. Attribute ‘Validate’ stops the cursor from moving forward, unless some value is entered in the current field.

3. The function $$IsEmpty returns a logical value as TRUE, only if the parameter passed to it contains NULL.

4. The function $$Value returns the value entered in the current field.

5. Thus, the Attribute ‘Validate’, used in the current field, controls the user from leaving the field blank, and forces a user input.

Field Level Attribute — Unique

This attribute takes a logical value. If it is set to Yes, then the values keyed in the field have to be unique. If the entries are duplicated, an error message Duplicate Entry pops up. This attribute is useful when a Line is repeated over UDF/Collection, in order to avoid a repetition of values.

Syntax

Unique : [Yes/No]

Example :

[!Field : VCHPHYSStockItem]

Table : Unique Stock Item : $$Line = 1

Table : Unique Stock Item, EndofList

Unique : Yes

In this code snippet, the field VCHPHYSStockItem is an optional field in DefTDL , which is used in a Physical Stock Voucher. The attribute Unique avoids the repetition of Stock Item names.

Field Level Attribute — Notify

It is similar to attribute ‘Validate’. The only difference is that it flashes a warning message and the cursor moves to the subsequent field. A system formula is added to display the warning message.

Syntax

Notify : <System Formula> : <Logical Condition>

Example :

[!Field : VCH NrmlBilledQty]

Set as : if @@HasInvSubAlloc then $$CollQtyTotal: BatchAllocations : $BilledQty else @ResetVal

Skip On : @@HasInvSubAlloc

Style : if @@IsInvVch then "Normal" else "Normal Bold"

Notify: NegativeStock :##VCFGNegativeStock AND @@IsOutwardType AND$$InCreateMode AND $$IsNegative: @@FinalStockTotal

Here, VCH NrmlBilledQty is a default optional field in TDL used in a Voucher. ‘Notify’ pops up a warning message, if the entered quantity for a stock item is more than the available stock, and the cursor moves to the subsequent field.

Field Level Attribute - Control

The attribute ‘Control’ is similar to Notify. The only difference is that it does not allow the user to proceed further after displaying a message. The cursor does not move to the subsequent field.

Syntax

Control : <System Formula> : <Logical Condition>

Example

[Field : VCH Number]

Use : Voucher Number Field

Inactive : @@NoVchNumbering

Skip On : @@AutoVchNumbering

Control  : DuplicateNumber : @@NoDupVchNumbering AND (NOT $$InAlterMode OR NOT @SameVchTypeAndNum)AND

$$IsDuplicateNumber : $$Value : SameVchTypeAndNum : $VoucherTypeName = ##ORIGVchType AND $$Value = ##ORIGVchNum

Validate : (@@NoDupVchNumbering AND NOT $$IsEmpty:$$Value) OR NOT @@NoDupVchNumbering

Keys     : PrevVchNumber

In this example, the field, VCH Number is a default field in TDL, used in a Voucher. The duplication of voucher numbers for a particular voucher type is prevented by using the attribute Control. The differences between the field attributes Validate, Notify and Control are:

Field Attributes

Displays Message

Cursor Movement

Validate

No

Restricted

Notify

Yes

Not Restricted

Control

Yes

Restricted

Form Leve l Attribute - Control

This attribute achieves a higher level of control on the contents of a Form, compared to the other controls used at the Lower levels of the Form. If the condition specified with ‘Control’ is not satisfied, then the Form displays an error message while trying to save. The Form cannot be saved until the condition in the attribute ‘Control’ is fulfilled.

Syntax

Control : <String Formula> : <Logical Formula>

Example

[Form : Voucher]

Control : DateBelowBooksFrom : $Date < $BooksFrom:Company : ##SVCurrentCompany

Control : DateBelowFromDate : $Date < $$SystemPeriodFrom

Control : DateBeyondToDate : $Date > $$SystemPeriodTo

In this example, Voucher is a default Form. While creating a voucher, the attribute Control does not accept dates beyond the financial period or before beginning of the books.

Menu Level Attribute - Control

The attribute Control restricts the display of Menu Items, based on the given condition.

Syntax

Control : <Item Name> : <Logical condition>

Example

[!Menu: Gateway of Tally]

Key Item : @@locAccountsInfo : A : Menu : Accounts Info. : NOT $$IsEmpty:$$SelectedCmps

Control  : @@locAccountsInfo : $$Allow:Create:AccountsMasters OR $$Allow:Alter:AccountsMasters

Here, the menu item Accounts Info will be displayed only if the condition is satisfied. $$Allow checks if the current user has the rights to access the report displayed under the current Menu item. The value AccountsMasters has been derived from attribute ‘Family’ at ‘Report’ definition.

Report Level Attribute - Family

The value specified with the attribute Family is automatically added to the security list as a pop-up, while assigning the rights under Security Control Menu.

Syntax

[Report : <Report Name>]

Family : <String Value>

Example

[Report : Ledger]

Family : "Accounts Masters"

Here, Accounts Masters will get added to the Security list. Without the user rights for ‘Accounts Masters’ in the Security controls, this report can neither be created, altered nor viewed.

Learning Outcome

Tally.ERP 9 caters to 3 different types of Reports. These are:

Tabular Reports: Reports with fixed number columns, which can be configured

Hierarchical Reports: Reports in successive levels or layers

Column based Reports: Reports with multiple columns

‘Explode’ is a Line attribute, which is used to take the current data from the Line Object.

$$KeyExplode function gives the current status of the keys Shift and Enter. This is used as a condition to check if the user has pressed the Shift+Enter Keys.

Multi column report is one where a column repeats, based on criteria specified by user.

Page Break is the point at which one page ends and another begins.

Data validation and controls in Tally can be done at 2 levels, viz. Platform and TDL levels.