HomeDeveloper ReferenceTDL ReferenceReports, Printing and Validation Controls

 

Explore Categories

 

Reports, Printing and Validation 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 TallyPrime, 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. 

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

TallyPrime 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: Simple Tabular 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.

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.

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 TallyPrime 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:

When the key Enter is pressed by the user, the next screen displays the Sub Groups of the current Group.

 

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:

AttributeColumn 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

[Report: MulCol Trial Balance]

ColumnReport : MyMultiColumns

Repeat : SVCurrentCompany, SVFromDate, SVToDate

 

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

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 Definition:- Repeating Field

[Line : MulCol TB Details]

Fields : MulCol TB Name Field, MulCol TB Amount Field

Repeat : MulCol TB Amount Field

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”

 

Step 2 : The Configuration Report ‘MultiAutoColumns’

  • 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.

  •  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

 

  • 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

3.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

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:

 

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/PrePrinted 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 – $$IsLastOfSet

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 – $$DoExplosionsfit

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.

Enhancements in Tally.ERP 9 Releases

Release 3.0

Image Printing Capabilities

Over the years, there has been a major requirement from the user community to enable Image Printing in Tally. Earlier, we used to achieve this capability by creating a new Font Type by associating an Image with a particular character and further using the ‘Style’ for the field. This had a few limitations in terms of image size, resolution and color. Also, it was not a clean way of incorporating the feature.

From this release onwards, Image Printing is being supported with the help of the following latest enhancements:

  • ‘Graph Type’ attribute of Part allowing the specification of BMP, enabled for ‘Print’ Mode
  • A new Definition Type ‘Resource’ introduced in TDL

The configuration settings allow the user to specify the location of the Image file and the same is printed as a logo on the top left of the following default Reports.

  • Sales Invoice – both Normal and Simple formats
  • Delivery Note/Challan
  • Debit Note
  • Credit Note
  • Outstanding Receivables
  • Remainder Letters
  • Pay Slips
  • Purchase Order
  • Receipt voucher
  • Confirmation of Accounts

Part Attribute – Graph Type

Prior to Tally.ERP 9 release 3.0, specification of Image (as BMP only) within a part was supported. The attribute Graph Type of the part is used for the same.

Syntax

[Part : Part Name]

Graph Type : Yes/Bitmap Image Path

Where,

<Graph Type> accepts ‘Yes’, or a path of the bmp file. If the value of <Graph Type> is “Yes”, then it will be treated as a graph. If the value is not “Yes”, then system will look for a Bitmap file with the given expression. However, the bitmap image was only supported in the ‘Display’ Mode.

From this Release onwards, this capability has been extended to ‘Print’ mode also. A few points are to be considered:

  1. The attribute ‘Graph Type’ supports Bitmap and JPG/JPEG. If the image type is specified as a JPEG/JPG, it will consume the same. If it is of any other type, this will be considered as BMP and the same will be located from the path specified. If the file is unavailable or is not a valid image file, then the area allocated for image will be blank.
  2. The Part containing ‘Graph Type’ cannot display or print any contents and any contents specified within the fields will be ignored. That’s why it requires the specification of dummy lines and fields within the part.
  3. Part Height and Width must be apportioned appropriately as per the Image size to be printed [If the height and/or width is not given, then the system will take the actual image size and use the same for display]. If the user has specified Height and/or width which is different from actual image size, then the system will do proportionate resizing of the image to fit into the given area [For example, let’s say that area allocated for the image is 300 X 300 and actual image size is 150 X 75. Then, the system will display image in 300 X 150].

New Definition Type – Resource

A new definition type “Resource” has been introduced in TDL. This will allow accessing and using the resources (images, icons, cursors, etc.) from a local disk, HTTP/FTP or from a DLL/EXE. The image formats supported at present are BMP/JPEG/ICON/CUR. The resource thus created can be used in a ‘Part’ definition using the attribute “Image”. This is applicable both in ‘Print’ and ‘Display’ mode.

Note : However, when the same report is exported in PDF, only BMP and JPEG are sup- ported. Other file formats will be ignored.

Syntax

[Resource : Name]

Source : <Path to Image file>

Resource : <NameOfResource> [:<DLL/EXE Name with path> ]

Resource Type : Bitmap/Icon/Jpeg/Cursor

Attributes – SOURCE, RESOURCE and RESOURCE TYPE

Attribute – SOURCE

This is a ‘Single’ type attribute, and hence accepts only one parameter. It allows us to specify the image file path. This file can be a local disk file, or a file available over an HTTP/FTP path.

Syntax

Source : <Path to Image file>

Where,

<Path to Image file> can be any string expression which evaluates to the file path, along with Filename and extension.

Example: 1

[Resource : CmpImage]

;; where the image “Tally.bmp” is available in local disk

Source : “C:\Tally.bmp”

Example: 2

[Resource : CmpImage ]

Source : “Http://www.tallysolutions.com/images/tallyHTTP.JPEG”

;; where the image tallyHTTP.JPEG is available over an HTTP Path

Attribute – RESOURCE

This is a ‘Dual’ type attribute and accepts two parameters. The first parameter refers to the resource name present in an Exe/DLL. The second parameter is used to specify the path and the name of Exe/DLL. However, this is optional. In case not specified, the system will look for the resource within tally.exe itself.

Syntax

Resource : <NameOfResource> [:<DLL/EXE Name with path>]

Where,

<Name of Resource> is a string expression which evaluates to the name of the resource present in the specified DLL/EXE (When resources are added to DLL/EXE, the user can give a separate name for the resource).

<DLL/EXE Name with path> can be a string which evaluates to the complete DLL/EXE path.

Example: 1

[Resource : CmpImage]

Resource : “TITLEICON”

;; This uses the resource “TITLEICON” present in Tally exe, as we have not specified the EXE path.

Example: 2

[Resource : CmpImage]

Resource : “60040” : C:\ProgramFiles\WindowsNT\Accessories\wordpad.exe

Resource Type : BMP

;; This uses the resource “60040” present in the wordpad.exe, as we have specified the EXE path as the second parameter.

Note : The attribute “Source” and “Resource” are mutually exclusive, i.e., either of them can be used. We cannot use both together. If both are specified in TDL, then the system will use SOURCE and ignore the RESOURCE attribute.

Attribute – RESOURCE TYPE

This is a ‘Single’ type attribute, and hence accepts only one value as a parameter. It allows the specification of Type of the resource. ‘Type’ can be any one of the standard windows image resources like Bitmap, Icon, Cursor or JPEG. The type specified in ‘Resource Type’ will be used for loading the image appropriately.

‘Resource Type’ is a mandatory attribute and must be specified for all sources. If not specified, the type would taken as ‘Bitmap’ by default.

Note: For the Icon resources – the nearest sized Icon will be taken. For example, if we have two Icons 16X16 and 32X32 and the part size is 20X20, then the 16X16 icon will be used for displaying.

Syntax

Resource Type : BMP/Icon/Jpeg/Cursor

Example

[Resource : CmpImage]

Source : “C:\Tally.bmp” Resource Type : BMP

Part Attribute – Image

Part Attribute – IMAGE

With the introduction of the new attribute “Image”, it is possible for the resource created by using the Definition “Resource” to be used in the Part.

Syntax

[Part : Par t Name]

Image : <Resource Name>

Where,

<Resource Name> is the name of the Resource definition.

Example

[Part : Part ABC]

Image : Cmp Image

Enhanced Columnar Capability

Columnar Reports in General

A matrix report looks like a grid. It contains a row of labels, a column of labels, and information in grid format that is related to both the row and column labels. In Tally, two dimensional matrix reports can be designed using the Auto column report approach (using Repeat Variables). Traditionally, these types of Reports are referred to as columnar Reports. In particular, Matrix report is a variant of automatic auto column reports, where the columns are repeated over a variable associated at the Report. The collection repeated with this variable is used to populate the repeated values into the variable. The method value in the detail line is extracted from a different collection, based on the corresponding row and column indexes.

Enhanced Capabilities for Columnar Reporting

The latest enhancements in the area of Columnar Reporting enables us to design the reports using a new approach altogether. A field within a line can display method values from multiple objects of the collection. Context Free repeat within the part and line enable repetition on simple as well as list variable values. These features give a better control in the hands of the programmer

These features give a better control in the hands of the programmer in designing such reports.

If we consider the above report layout, the labels in columns can now repeat over a collection of Parties. The data in the cells can be populated based on the combination of row and column label values across the dimensions. In the previous table, for example, the highlighted cell contains the value of total sales quantity corresponding to the party “Party 2” for the Stock Item “Stock Item 2”.

The following enhancements have been enabled to achieve this functionality:

  • ‘Repeat’ Attribute for Part and Line over a Collection
  • Context Free Repeat for Part and Line, together with SET/Break On
  • Usage of the function $$LineObject

Attribute ‘Repeat’ Enhancements – Part and Line

The ‘Repeat’ Attribute has been enhanced consistently across ‘Part’ and ‘Line’ Definitions to support “Context Based” as well as “Context Free” Repeat.

Attribute REPEAT – Part Definition

The common syntax allows the repetition of a contained line, with or without a collection.

Syntax

[Part : <Part Name>]

Repeat : <Line Name> [: <Collection>]

Set : <Count>

Where,

<Part Name> is the name of the part.

<Line Name> is the name of the line to be repeated.

<Collection> is the name of collection on which the line is repeated. It is an optional parameter.

<Count> denotes the number of times the line is to be repeated, if Collection Name is not specified.

Context based Repeat – The ‘Repeat’ attribute of the Part can repeat the contained line over a collection. Each line in this case is associated with each object of the collection. This was the earlier capability even before Tally.ERP 9.

Context Free Repeat – From Release 1.8, the Collection parameter in the above syntax has been made optional. This allows the repetition of a contained line without a collection. Since the no. of times the line has to be repeated is not known, the usage of the attribute SET to specify the count becomes mandatory. In case of ‘Edit’ mode, the attribute ‘Break On’ can be used to specify the terminating condition for repetition.

Attribute REPEAT – Line Definition

So far, the ‘Repeat’ attribute at ‘Line’ definition has been accepting only a field name which internally uses the repeat behaviour of the Report and Variable for determining the no. of times it can be repeated. This attribute has now been enhanced to support the consistent syntax to enable “Context Based” and “Context Free” repetition of the same field horizontally.

Syntax

[Line : <Line Name>]

Repeat : <Field Name> [: <Collection Name>]

Set : <Count>

Where,

<Line Name> is the name of the Line.

<Field Name> is the name of the Field to be repeated.

<Collection Name> is the name of the collection on which the Field is repeated. It is optional.

<Count> denotes the no. of times the Field has to be repeated, if collection name is not specified.

Context based Repeat – The ‘Repeat’ attribute of the line can repeat the contained field over a collection. Each field in this case is associated with each object of the collection.

Context Free Repeat – The collection parameter in the above syntax is optional. This allows the repetition of a contained field without a collection. Since the no. of times the field is to be repeated is not known, the usage of the attribute SET to specify the count becomes mandatory. In case SET is not specified, the Field will be repeated as per the existing Columnar behaviour.

Example 1: Item-Wise Party-Wise sales quantity report using Context-Based Repeat of Field

Following is the code snippet to design the above report using enhanced columnar capability:

  1. Collection definitions for Stock Item wise Party, sales quantity etc., are as follows:

[Collection : Smp CFBK Voucher]

Type : Voucher

Filter : Smp IsSalesVT

[Collection : Smp Stock Item]

Source Collection : Smp CFBK Voucher

Walk : Inventory Entries

By : IName : $StockItemName

Aggr Compute : BilledQty : SUM : $BilledQty

Keep Source : ().

Filter : SmpNonEmptyQty

[Collection : Smp CFBK Party]

Source Collection : Smp CFBK Voucher

Walk : Inventory Entries

By : PName : $PartyLedgerName

Aggr Compute : BilledQty : SUM : $BilledQty

Keep Source : ().

Filter : Smp NonEmptyQty

[Collection n : Smp CFBK Summ Voucher]

Source Collection : Smp CFBK Voucher

Walk : Inventory Entries

By : PName : $PartyLedgerName

By : IName : $StockItemName

Aggr Compute : BilledQty : SUM : $BilledQty

Keep Source : ().

Search Key : $PName + $IName

;; System Formula

[System : Formula]

Smp IsSalesVT   : $$IsSales:$VoucherTypeName

Smp NonEmptyQty : NOT $$IsEmpty:$BilledQty

From these Collections, following can be observed:

  • The Rows, i.e., Stock Items, are repeated over the Collection ‘Smp Stock Item’.
  • The Columns, i.e., Party Names, are repeated over the Collection ‘Smp CFBK Party’.
  • The Intersection values between these Rows and Columns, i.e., Item wise Party wise Sales Quantity, are set using the Collection ‘Smp CFBK Summ Voucher’. This Collection is indexed on Methods $PName + $IName using the Collection Attribute ‘Search Key’. Thus, the Collection is indexed on Party Name and Stock Item Name, which makes it unique across all the Objects within the Collection ‘Smp CFBK Summ Voucher’.

The Lines for Title and Details are repeated for the Party Names as shown below:

[Line : Smp CFBK Rep Title]

Use : Smp CFBK Rep Details

Local : Field : Default : Type : String

Local : Field : Default : Align : Center

Local : Field : Smp CFBK Rep Name : Set as : “Particular s ”

Local : Field : Smp CFBK Rep Name : Widespaced : Yes

Local : Field : Smp CFBK Rep Party : Set as : $PName

Local : Field : Smp CFBK Rep Party : Lines : 0

Local : Field : Smp CFBK Rep ColTotal : Set as : “Total”

[Line : Smp CFBK Rep Details]

Fields : Smp CFBK Rep Name , Smp CFBK Rep Party , S mp CFBK Rep Col Total

Repeat : Smp CFBK Rep Party : Smp CFBK Party

Title Line uses the detail line where the Field “Smp CFBK Rep Party” is repeated over the Collection “Smp CFBK Party”. In the Title Line, the Field “Smp CFBK Rep Party” is set with the value “$PName”, which sets the Party Names from the Collection “Smp CFBK Party”.

  1. Retrieving the values in cells based on Party name available from context and stock item name available in the field as shown below:

[Field : Smp CFBK Rep Name]

Use : Name Field

Set as : $IName

Display : Stock Vouchers

Variable : StockItemName

[Field : Smp CFBK Rep Party]

Use : Qty Primary Field

Set as : $$ReportObject:$$CollectionFieldByKey:$BilledQty:@SKFormula:SmpCFBKSummVoucher

SKFormula : $PName + #SmpCFBKRepName

Format : “NoZero”

Border : Thin Left

In this code snippet, we can observe that the Field “Smp CFBK Rep Party” is the intersection between rows & columns. The value is gathered from the Collection “Smp CFBK Summ Voucher” using the function $$CollectionFieldByKey, where the Index Key in the current context is passed as a parameter. “$PName” in the current object context returns the Party Name. Similarly, the Field Value “#SmpCFBKRepName” in the current context returns the Stock Item Name. Hence, the Search Key Index “Party Name + Stock Item Name” for every Intersection point is passed to this function, which extracts and returns the corresponding Quantity from the Collection.

  1. Calculating Field Level Totals, i.e., Stock Item Totals, across all Parties is done using the Line Attrib u te ‘ Total ’ and the Function $$Total , as shown below:

[Line : Smp CFBK Rep Details]

Total : Smp CFBK Rep Party

[Field : Smp CFBK Rep Col Total]

Use : Qty Primary Field

Set as : $$Total:SmpCFBKRepParty

Line “Smp CFBK Rep Details” contains an Attribute ‘Total’, which accepts Field Names as its value. In other words, we declare at the Line that the Fields are to be summed for later use. This sum gets accumulated and rendered in the Field “Smp CFBK Rep Col Total”, where the function

$$Total returns the accumulated Total for the given Field Name as the Parameter to this Function.

New Built–in Function $$LineObject

Since the Line Attribute ‘Field’ can now be repeated over a Collection, wherein the Object context inherited from the Line is overridden in the Field; to switch back to the parent context, i.e., Line’s object context and extract the required method value, a New Function $$LineObject has been introduced.

Function – $$LineObject

Syntax

$$LineObject : <String Formula>

Where,

<String Formula> can be any expression that gets evaluated in the Object context associated at the current field’s parent ‘Line’ in the Interface Object hierarchy.

Interactive Reporting capabilities using Aggregated or External objects

The Actions “Remove Line”, “Show Last Removed Line” and “Show Removed Lines” work on the concept of Object Identifier. Whenever the collection of internal objects is rendered as a report, the default buttons “Remove Line” and “Restore Line” using the above actions work on them as they are uniquely identifiable.

In cases where the Collection used contains aggregated Objects, or objects from an external data source like XML, etc., the objects available do not contain a unique identifier. When such collections are rendered, the Actions mentioned above do not work.

In order to overcome the problem, the behaviour of the attribute ‘Search Key’ has been enhanced to assign a unique key for such Object Types. It takes a single method or a combination of methods, which will serve as a unique identifier to each object of the aggregated or external collection. It has to be ensured that each object in the collection must contain unique values for the method which is assigned as the key.

Attribute ‘Search Key’ enhanced

Syntax

[Collection : <Collection Name>]

Search Key : <Expression>

Where,

<Expression> evaluates to a unique identifier for each object of the collection. It is usually a combination of method names separated by ‘+’, which must make a unique combination for each object of the Collection.

Example:1

Please observe the previous sample Item-Wise Party-Wise report, wherein Alt + R Key combination does not work for Removal of Line, as there is no unique identifier for the Line Object. Each line in the example is repeating over the objects of the collection “Smp Stock Item”. To specify the unique Object identifier, this Collection is altered by specifying the ‘Search Key’ attribute, with a unique combination of Methods as value. In this case, it is the method name $Iname, i.e., the Stock Item Name, based on which the objects are grouped.

[#Collection : Smp Stock Item]

Search Key : $IName

Example: 2

Following is another example using external data objects as available in the following XML file, containing the data for Students and corresponding marks in various subjects.

<StudData>

<Student>

<Name> Rakesh</Name>

<Subject>

<Name>History</Name>

<Mark>90</Mark>

</Subject>

<Subject>

<Name>Civics</Name>

<Mark>90</Mark>

</Subject>

<Subject>

<Name>Kannada</Name>

<Mark>90</Mark>

</Subject>

</Student>

<Student>

<Name>Uma</Name>

<Subject>

<Name>History</Name>

<Mark>80</Mark>

</Subject>

<Subject>

<Name>Civics</Name>

<Mark>50</Mark>

</Subject>

<Subject>

<Name>Kannada</Name>

<Mark>65</Mark>

</Subject>

</Student>

<Student>

<Name>Prashanth</Name>

<Subject>

<Name>History</Name>

<Mark>50</Mark>

</Subject>

<Subject>

<Name>Civics</Name>

<Mark>90</Mark>

</Subject>

<Subject>

<Name>Kannada</Name>

<Mark>90</Mark>

</Subject>

</Student>

</StudData>

The data populated from the above XML is displayed as a columnar report as follows:

Student-wise Subject-wise Marks information is listed in tabular form, as shown in the figure. Now, on removing the selected line(s), the required lines must be removed. Since this report is constructed out of an external source, i.e., XML Data, the same requires a unique identifier for each object in the repeated line. In this case, it is the Student Name; hence, the Search Key should contain this as an identifier.

Following is the sample code required to display the above report in a columnar fashion, with the Remove/Restore Line behaviour incorporated:

[Report : Ext XML Data Stud]

Form : Ext XML Data Stud

[Form : Ext XML Data Stud]

Parts : Ext XML Data Stud

Bottom ToolBar Buttons : Bottom ToolbarBtn8, Bottom ToolbarBtn9,+

BottomToolbarBtn10

[Part : Ext XML Data Stud]

Lines : Ext XML Data Stud Heading, Ext XML Data Stud Info

Repeat : Ext XML Data Stud Info : Ext XML Data Students

Scroll : Vertical

CommonBorder : Yes

[Line : Ext XML Data Stud Heading]

Fields : Ext XML Data Stud Name, Ext XML Data Stud Mark

Repeat : Ext XML Data Stud Mark : Ext XML Data Stud Subj Summary

Local : Field : Default : Type : String

Local : Field : Default : Style : Normal Bold

Local : Field : Default : Align : Centre

Local : Field : Ext XML Data Stud Name : Set As : “Student Name”

Local : Field: Ext XML Data Stud Mark: Set As: $S u bjectName

Local : Collection: Ext XML Data Stud SubjSummary: Delete: Filter

Local : Collection: Ext XML Data Stud SubjSummary: Delete : By: Student Name

Border : Thin Top Bottom

[Line: Ext XML Data Stud Info]

Fields : Ext XML Data Stud Name, Ext XML Data Stud Mark

Repeat : Ext XML Data Stud Mark: Ext XML Data Stud Subj Summary

[Field : Ext XML Data Stud Name]

Use : Name Field

Set A s : $Name

[Field : Ext XML Data Stud Mark]

Use : Number Field

Set A s : $$Number:$SubjectTotal

Align : Right

Border : Thin Left

[Collection : Ext XML Data Students]

Data Source : File XML : “D:\StudData.XML” : Unicode

XML Object Path : Student : 1 : StudData

Search Key : $Name

[Collection : Ext XML Data Stud Subj Summary]

Source Collection : Ext XML Data Students

Walk : Subject

By : Student Name : $..Name

By : Subject Name : $Name

Aggr Compute : Subject Total : SUM : ($$Number:$Mark)

Keep Source : ().

Filter : ForThisStudent

[System : Formula]

ForThisStudent : $StudentName = $$ReqObject:$Name

In this code, Line ‘Ext XML Data Stud Info’ is repeated over the Collection ‘Ext XML Data Students’, where Search Key is specified to be $Name. Hence, the Remove/Restore Line behaviour will work.

Release 3.62

Multiple Orientation Support for Printing

Currently, Tally supports printing of multiple forms within a single report in single orientation only, i.e., all the forms within a report can be printed either in Portrait or in Landscape format only, as specified in the report.

In order to support the printing of multiple forms within a single report in different orientations, the behaviour of Variable SVPrintOrientation has been enhanced.

To achieve this behaviour, the local declaration of the Variable SVPrintOrientation at Report level is mandatory, and its value must be set using the form level attribute ‘Set Always’ in individual forms.

This will be very useful in scenarios where multiple forms are being printed from a single report. For example, from a Payment Voucher, one needs to print both Voucher and Payment Advice. However, the Payment Voucher needs to be printed in ‘Portrait’ form, and the Payment Advice in ‘Landscape’.

Example

[Report: TSPL Smp VarSVPrintOrientation Extended]

Form : TSPLSmpVarSVPrintOrientationFrm1,  TSPLSmpVarSVPrintOrientationFrm2

;; Mandatory Local declaration of Variable SV Print Orientation

Variable : SV Print Orientation : String

[Form: TSPL Smp VarSVPrintOrientation Frm1]

;; Orientation of this Form is set to ‘Portrait’

Set Always : SV Print Orientation : “Portrait”

[Form : TSPL Smp VarSVPrintOrientation Frm2]

Use : TSPL Smp VarSVPrintOrientation Frm1

;; Orientation of this Form is set to ‘Landscape’

Set Always : SV Print Orientation : “Landscape”

In this example, the report TSPLSmpVarSVPrintOrientation Extended has two forms, viz. TSPLSmpVarSVPrintOrientationFrm1 and TSPLSmpVarSVPrintOrientationFrm2 .

Based on the value set to the variable SV Print Orientation, both the forms are being printed in the respective orientation.

Release 4.7

Columnar Capability in Edit Mode

Multiple-Column feature in Tally.ERP 9 has till date been used by the Tally users for various reporting needs like Comparative Analysis of Data across Multiple Periods (Months, Quarters, Years, etc.), Multiple Companies, Multiple Godowns, etc. It can also be used for comparative study of various parameters like Budget vs. Actual Performance, by getting the same displayed in the form of a column-based report.

It was felt highly desirable if, apart from these reporting functionalities, various data entry operations could also be performed in a Columnar or Tabular manner. This would not only facilitate data entry in a simple, user friendly manner, but also considerably reduce the time taken to enter the data. For instance, Attendance of Employees could be accepted against the Attendance Types or days, in a Tabular format. Similarly, other examples could be Employee-wise Pay Head-wise Salary Structure, Stock Item-wise Price Level-wise Price List, etc., where this capability could be used effectively. In order to make this possible in Tally, the Columnar capability was required to be extended to support Edit mode.

From Release 4.7 onwards, support for Multi Columns has been extended to Edit Mode too, to enable the developer to design and implement such functionalities in Tally, as per requirement.

To make this possible in TDL, the Horizontal Scrolling behaviour has been enhanced to work in Edit Mode, which will enable the developer to create a user friendly interface, thereby allowing the user to enter data conveniently in tabular format. To achieve the columnar scrolling behaviour; in TDL, fields within the required line can be repeated over either of the following:

  • Collection of Objects , OR
  • Sub-Collections under a Primary Object, provided the Sub-Collections contain Object(s)

In the absence of the above ‘Repeat’ specification, the only criterion to repeat the Fields/ Columns is that the number of Fields to be repeated must be known to the Line.

Note: With respect to Object context, Horizontal Scroll will only happen if Objects/Sub Objects, on which Columns are to be repeated, exist. In other words, in Create Mode with Object Context, Horizontal Scroll will not work as the number of fields to be repeated is not known.

 

Release 5.4.9

In TDL, to make the programming simpler and to optimise the reporting and query area, we have introduced two definitions – Rule Set and Name Set, and two data types – Flag Set and Num Set.

Definition – Rule Set

Rule Set is a definition in TDL and can be used to define a set of rules. You can use this definition to evaluate the rules efficiently. Rule Set can be defined with a single dimension or multiple dimensions along with flow control. The attribute Rule Set and related functions help to evaluate the defined Rule Sets. The result of a Rule Set is always an Object method of Flag Set data type. The functions related to Flag Set data type allow you to access the Flag Set. Storing the Flag Set result in the database is currently not supported. For example, during voucher acceptance, the Rule Set can be used to check the correctness of data.

The definition Rule Set makes TDL programming simpler because of its ability to allow a developer to scope only one validation at a time and not all of them together. It reduces the code size. It also provides the named identity to access flag set values. Rule Set increases the efficiency of the programme, which is measured on performance and memory usage.

Syntax

[Rule Set: <Rule Set Name>]

Where,

< Rule Set Name > is the name of the Rule Set.

Various attributes and functions, which are related to Rule Set are explained below:

Attribute – Break On

Break On is a single type attribute with constant value. You can use the attribute Break On in Rule Set definition to determine the continuation of evaluation in the current rule set. It provides vertical flow control to evaluate the rules. Break on can also be mentioned with Rule attribute.

Syntax

Break On: <Logical Constant>

Where, < Logical Constant > is Yes / No .

While evaluating each rule,

  • If the value of Break On matches with the result of the rule, then the evaluation flow will break and further rules are not evaluated in the current Rule Set. The remaining rule values default to No .
  • If the attribute Break On is not specified, the evaluation flow continues, irrespective of the result of rule.

Attribute – Walk On

Walk On is a single type attribute with constant value. The attribute Walk On helps to determine whether the next dimension will be evaluated or not, for the current rule. It has diagonal flow control to evaluate the steps.

Syntax

Walk On: <Logical Constant>

Where, < Logical Constant > is Yes/No.

While evaluating each rule,

  • If the value of Walk On value matches with the result of the rule, then the evaluation flow continues to evaluate the next dimension in the current rule context. If the next dimensions are not evaluated, the rule values default to No.
  • If the attribute Walk On is not specified, the evaluation flow continues to evaluate the next dimension, irrespective of the result of the rule.

Attribute – Rule

Rule is a Triple list attribute. You can use the attribute Rule to define a rule. It accepts three parameters.

Syntax

[Rule Set: <Rule Set Name>]

Rule : <Rule Identifier>: <Logical Expression>[: <Keyword>]

Where,

<Rule Identifier> is the name of the rule to identify or access the rule later. “*” and “?” are not supported as rule names.

<Logical Expression> evaluates in the context of requester/source/target object being passed from evaluation context.

<Keyword> specifies the value of Break On sub-attribute for current rule. If no specification is provided, it inherits the Break On attribute value at current rule set level.

Possible options are

True/Yes: When the result of the rule is True/Yes, it stops the evaluation further in the current rule set. The next dimension gets evaluated for the current rule.

False/No: When the result of the rule is False/No, it stops evaluating further.

Never: It continues the evaluation, irrespective of rule result.

Example

[Rule Set: My Rule Set]

;; Yes/No or Not Specified

Break On : Yes

Rule : A1 : @@TNAnnexure1Included

Rule : A2 : @@TNAnnexure2Included: No

In the above example, A1 , A2 are rule identifiers. @@TNAnnexure1Included and @@TNAnnexure2Included are rule expressions.

Attribute – Aggr Rule

Aggr Rule is a Triple list type attribute and it accepts constant values as parameters. You can use Aggr Rule to specify various pre-defined aggregation for Rule Set.

Syntax

Aggr Rule: <Identifier>: <Type of aggregation>[: <Level Indicator>]

Where,

<Identifier> is to specify the identifier for the aggregate rule. It can be accessed from Flag Set like any other flags.

<Type of aggregation> is to specify the type of aggregation. (Any True / OR, All True / AND)

<Level Indicator> is to indicate the level for aggregation. It is always relative to the current rule set. The default value of this parameter is One. This parameter to be specified by using a level number from the current rule set to identify the level.

The aggregate flags are accessed using the same dotted notation like any other flags. Value of these rule flags are aggregation results, which are computed at the time of rule evaluation.

When multiple flag sets are aggregated, similar to Aggr Compute: SUM in the collection, these aggregate flags are also further aggregated (counts) into Num Sets.

The first Aggr Rule result of the root/top-level Rule Set is stored into the Zero th flag. If no aggregate rule is specified in the hierarchy, the first rule result is stored at Zero th flag.

Zero th flag value is also referred to as the master aggregate rule value.

Attribute – Rule Set

Rule Set is a Triple list attribute. You can use the attribute Rule Set to specify the rule set for the next dimension of each rules in the current rule set. Rule Set attribute accepts three parameters.

Syntax

Rule Set: <Rule Set Name>: [<CurrentDefinitionRules> : <NextDimensionRules>]

Where,

<Rule Set Name> is the name of the next dimension Rule Set. It is the Rule Set description reference to another Rule Set definition.

<CurrentDefinitionRules> are the rules in the current rule set and it has the given Rule Set as next dimension. If it is not specified, it assumes all rules in the current rule set have the given rule set as next dimension.

<NextDimensionRules> are the rules in next dimension Rule Set that have to be evaluated. If not specified, it assumes all rules in next dimension rule set are to be evaluated. The results are available as part of the Flag Set generated by Rule Set evaluation.

The attribute Rule Set accepts multiple values. Each rule can have a different Rule Set for its next dimension.

A Rule Set already present in the hierarchy at any level is not allowed to be specified as the next dimension again.

Attribute – Name Set

Name Set is a Single type attribute. You can use the attribute Name Set to specify the default name set definition for the current rule set. In general, Name Set contains rule descriptions.

Syntax

Name Set: <Name Set Definition Name>

Where,

<Name Set Definition Name> is the name of Name Set definition to map the current rule set. Name Set can be used in two ways:

  1. To specify the default name of the name set definition name when it is used with the attribute Name Map, without using the third parameter of Name Map.
  2. Use the attribute Name Set without using Name Map – automatically it will get mapped based on the rules in the current rule set, if the identifiers in Name Set match the rule identifier.

Attribute – Name Map

Name Map is a triple list type attribute. You can use the attribute Name Map to specify explicit name mapping for Rule descriptions. It accepts three parameters.

Syntax

Name Map: <Rule Name>:<Name Identifier>[:<Name Set Definition Name>]

Where,

<Rule Name> is an identifier to Rule in the current rule set. This name is defined in Rule attribute.

<Name Identifier> is specified in the Name Set definition.

<Name Set Definition Name> is an optional parameter and it is the name of Name Set definition. If this sub-attribute is specified, then the string value is accessed from Name Set which is mentioned here. If it is not mentioned it assumes the Name Set Definition Name mentioned in Name Set attribute in the current Rule Set.

Either the third parameter of Name Map or a Name Set attribute should be specified. Otherwise, the specific name map will be ignored.

Name Map is useful to map the error strings inline with each Rule Set.

Function – EvaluateRuleSet

The function EvaluateRuleSet evaluates the Rule Set and returns a Flag Set data type. It returns a Flag Set type, which is constructed with flags and dimensions as per the Rule Set definition provided, and evaluated on the current contexts.

Syntax

$$EvaluateRuleSet:<Rule Set Name>

Where,

<Rule Set Name> is the name of the Rule Set definition. It returns Flag Set data type.

Static modifiers like Add, Change, and Delete are supported in rule set definition.

Local formula is supported with the definition rule set. The local formula can be accessed only from the Rule Set in which the local formula is defined.

Example – Rule Set

[Rule Set: My Rule Set]

;; Yes/No or Not Specified

Break On : Yes

;;RuleName ;; Rule Logical Expression ;; break on (override)

Rule : A1 : @@TNAnnexure1Included

Rule : A2 : @@TNAnnexure2Included : No

Rule : A3 : @@TNAnnexure3Included

;; Second Dimension RuleSet ;; My Rules ;; Dimension Rules (Filter)

RuleSet : Anx_ErrorsA : A1 : EA1, EA2

RuleSet : Anx_ErrorsB : A2, A3 : EB2, EB3

;; Aggregate Rules

Aggr Rule : Is Included In Any Annexure: IsAnyTrue : 1

Aggr Rule : Has Any Error : IsAnyTrue : 2

;; option1 Name Set mapping

[Rule Set: Anx_ErrorsA]

Break On : Yes

;; ;;RuleName ;; Rule Logical Expression ;;break/continue condition

Rule : EA1 : @@TN_Error1

Rule : EA2 : @@TN_Error2 : No

Rule : EA3 : @@TN_Error3

[Rule Set: Anx_ErrorsB]

Break On : Yes

;; ;;RuleName ;; Rule Logical Expression ;; break/continue condition

Rule : EB1 : @@TN_Error4

Rule : EB2 : @@TN_Error5 : No

Rule : EB3 : @@TN_Error6

In the above example, My Rule Set is the name of the Rule Set. A1, A2, and A3 are three different rules defined under My Rule Set. The rule A2 has Break On override by setting its third parameter as No. In this case, rule A2 works based on the local value of Break On. @@TNAnnexure1Included, @@TNAnnexure2Included , @@TNAnnexure3Included are logical expressions and defined for A1, A2, A3 respectively.

Anx_ErrorsA, Anx_ErrorsB are second dimension rule sets. Using these rule sets, it filters the first dimension rules based on the requirement. The rules EA1 and EA2 are second dimension rules and these rules are applicable only for the Rule A1. Similarly, EB2 and EB3 rules are applicable only for A2 and A3.

Is Included In Any Annexure and Has Any Error are two aggregate rules defined to pre-compute the aggregation for the Rule Set MyRuleSet by identifying the level. The aggregate rule Is Included In Any Annexure evaluates in the first level whereas the aggregate rule Has Any Error evaluates in the second level.

Definition – Name Set

Name Set is a definition to ensure that strings are always segregated and separated from the source code expressions. It helps to define a set of Name-Value pairs. It is a convenient way to define static string data, and access the strings easily.

You can use Name Sets to define application string groups like – error strings for a given rule, static application data like a list of states, list of countries, and so on. Name Set also supports being specified as the data source in a collection. It will result in a collection where each object represents a Name-Value pair in the Name Set.

You need to define all strings of the application together using Name Sets to make the corrections of strings easy. In other words, managing strings is made easier by using the Name Set.

Syntax

[Name Set: <Name Set Name>]

Where,

<Name Set Name> is the name of the Name Set.

Various attributes and functions in Name Set are explained below:

Attribute – List Name/List

List Name is a Dual list type attribute with a constant name and value. You can use the attribute List Name to specify the identifier and the string. The identifier can be used to access the value stored in the list.

Syntax

List Name : <string identifier 1> : <string 1>

List Name : <String identifier 2> : <string 2>

Where,

< string identifier 1 >, < string identifier 2 > are user defined identifiers for the strings < string 1 >, < string 2 >.

Function – NameGetValue

Function NameGetValue returns a string in the Name Set based on the values passed. The function NameGetValue takes two parameters, String identifier and Name Set Description Name .

Syntax

$$NameGetValue:<String Identifier>:<Name Set Description Name>

Where,

< String Identifier > is the list name identifier.

< Name Set Description Name > is the name of the Name Set.

Example

[Nameset : AnnexureErrorStrings]

List Name : E1 : “PAN Number Invalid”

List Name : E2 : “Lorry Number Missing”

List Name : E3 : “Commodity Code is Empty”

[Function NameSetTestFunction]

01 : LOG : $$NameGetValue:E2:AnnexureErrorStrings

;; This will print “Lorry Number Missing”

[Collection: My Collection]

Data Source : Name Set : AnnexureErrorStrings

The collection My Collection delivers 3 objects, as given below:

  • $Name: E1, $Value = “PAN Number Invalid”
  • $Name: E2, $Value = “Lorry Number Missing”
  • $Name: E3, $Value = “Commodity Code is Empty”

Data Type – Flag Set

Flag Set data type stores a set of logical values/flags. It takes less memory to store flag set values compared to the memory takes to store individual logical values. It allows to perform operations on the stored values. This is a variable length data type and hence has no restriction on the number of flags. Currently, Flag Set is generated as a result of Rule Set evaluation. You can use Flag Set data type in Variables and Objects.

This data type is not directly input-able by the user and not directly displayable to the user.

The following Flag Set functions help you to perform the operations on Flag Set data type.

Function – FlagGetValue

You can use the function FlagGetValue to get the value of a flag inside a Flag Set. It returns a logical value.

Syntax

$$FlagGetValue:<Rule Identifier>:<Flag Set Expression>

Where,

< Rule Identifier > is a constant identifier or an expression that results in a rule identifier which is in dotted notation.

< Flag Set Expression > evaluates to a Flag Set value.

Example

$$FlagGetValue:A1.B2:$MyFlagSet

For flag names, a dotted notation must be used to denote the fully qualified name of a flag. It shows the path of rule evaluation.

When “*” is passed as the Rule Identifier, it returns the master aggregate value (Zeroth flag value) of the Rule Set.

Function – FlagSetOR

The function FlagSetOR takes two flag sets as input and it performs the OR operation on them. It returns a Flag Set data type. Both flag sets must be obtained by evaluating the same rule set (potentially with different objects), otherwise, this function fails.

Syntax

$$FlagSetOR:<Flag Set 1>:<Flag Set 2>

Where,

< Flag Set 1 > is the first Flag Set expression.

<Flag Set 2> is the second Flag Set expression.

Example

$$FlagSetOR:$FlagSetA:$FlagSetB

Function – FlagSetAND

The function FlagSetAND takes two Flag Sets as input and it performs AND operation. It returns Flag Set data type. Both flag sets must be obtained by evaluating the same rule set (potentially with different objects), otherwise this function fails.

Syntax

$$FlagSetAND:<Flag Set 1>:<Flag Set 2>

Where,

< Flag Set 1 > is the first Flag Set expression.

< Flag Set 2 > is the second Flag Set expression.

Example

$$FlagSetAND:$FlagSetA:$FlagSetB

Function – FlagsIsAllTrue

The function FlagsIsAllTrue returns true if all child rules under the given rule are True (AND operator). It returns a logical type.

Syntax

$$FlagsIsAllTrue:<Parent Rule Identifier>:<Flag Set Expression> [:<Belongs To>]

Where,

<Parent Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. This is used as parent flag.

<Flag Set Expression> is the expression which results in a Flag Set on which this operation is to be performed.

<Belongs To> is the logical value to decide whether only immediate children or all children in the hierarchy of the given parent rule, to be considered. If this parameter is not specified, the default value is No.

Example

$$FlagsIsAllTrue:A1:$MyFlagSet:Yes

”*” can be passed as Rule Identifier to perform the operation from the root rule set level. If the parent rule does not have any child rules, then the function returns No .

Function – FlagsIsAllTrueFromLevel

The function FlagsIsAllTrueFromLevel returns True, if all flags are True at a given level. It returns a logical value.

Syntax

$$FlagsIsAllTrueFromLevel:<Peer Rule Identifier>:<Flag Set Expression> [:<Leaf Rule Filter>]

Where,

<Peer Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. It is used to specify the level and the starting point of the aggregation/operation/walk.

<Flag Set Expression> is the expression which results in a Flag Set on which this operation is to be performed.

<Leaf Rule Filter> is the Rule Name to filter the non-qualified leaf flag. If specified, only rules ending with this Rule Name will be considered for the aggregation. If not specified, all rules at the specified level will be considered.

Example

$$FlagIsAllTrueFromLevel:A1.B1:$MyFlagSet:B1

In the above example, the rule B1 is the Leaf Rule Filter. A1.B1 denotes the second level and the starting point for aggregation. Since B1 is the Leaf Rule Filter, it considered A1.B1 and other rules which end with B1. The rules such as A1.B2 will not be considered.

*” is not applicable for this function.

It walks all flags in the same level as that of the Rule Identifier specified, starting from the given rule identifier. To consider all rules at a certain level, specify the identifier of the first rule in that level.

Function – FlagsIsAnyTrue

The function FlagsIsAnyTrue returns True , if any child rule of a given flag is True (OR operator). It returns a logical value.

Syntax

$$FlagsIsAnyTrue:<Parent Rule Identifier>:<Flag Set Expression> [:<Belongs To>]

Where,

<Parent Rule Identifier > is a constant identifier or an expression that results in a rule identifier which is in dotted notation. This is used as parent flag.

< Flag Set Expression > is the expression which results in a flag set on which this operation is to be performed.

<Belongs To> is the logical value to decide whether only immediate children, or all children in the hierarchy of the given parent rule, to be considered. If this parameter is not specified, the default value is No.

Example

$$FlagsIsAnyTrue:A1:$MyFlagSet:Yes

“*” is used to perform the operation from the root rule set level.

If the parent rule does not have any child rules, then the function returns No .

Function – FlagsIsAnyTrueFromLevel

The function FlagsIsAnyTrueFromLevel returns True, if any flags are True at a given level. It returns a logical value.

Syntax

$$FlagsIsAnyTrueFromLevel:<Peer Rule Identifier>:<Flag Set Expression>:<Leaf Rule Filter>

Where,

<Peer Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. It is used to specify the level and the starting point of the aggregation/operation/walk.

<Flag Set Expression> is the expression which results in a Flag Set on which this operation to be performed.

<Leaf Rule Filter> is the Rule Name to filter the non-qualified leaf flag. If specified, only rules ending with this Rule Name will be considered for the aggregation. If not specified, all rules at the specified level will be considered.

Example

$$FlagIsAnyTrueFromLevel:A1.B1:$MyFlagSet:B1

In the above example, the rule B1 is the Leaf Rule Filter. A1.B1 denotes the second level and the starting point for aggregation. Since B1 is the Leaf Rule Filter, it considered A1.B1 and other rules which end with B1 . The rules such as A1.B2 will not be considered.

“*” is not applicable for this function.

This function walks all flags in the same level as that of the Rule Identifier specified, starting from the given rule identifier. To consider all rules at a certain level, specify the identifier of the first rule in that level.

Function – FlagsCount

You can use the function FlagsCount to get the number of flags under a given parent rule matching the value passed. It returns a number type.

Syntax

$$FlagsCount:<Parent Rule Identifier>:<Flag Set Expression>: [<Flag Value>:<Belongs To>]

<Parent Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. This is used as parent flag.

<Flag Set Expression> is the expression which results in a Flag Set on which the operation is to be performed.

<Flag Value> is a logical value. It can be either True/Yes or False/No. It is used to count flags that match this value. The default value is True/Yes .

<Belongs To> is the logical value to decide whether only immediate children, or all children in the hierarchy of the given parent rule, to be considered. If this parameter is not specified, the default value is No.

Example

$$FlagsCount:A1:$MyFlagSet:Yes:Yes

” *” is used to perform the operation from the root rule set level. If the parent rule does not have any child rules, then the function returns .

Function – FlagsCountFromLevel

You can use the function FlagsCountFromLevel to get the number of flags at the same level, across parents, matching the flag value passed. It returns a number type.

Syntax

$$FlagsCountFromLevel:<Peer Rule Identifier>:<Flag Set Expression>: [<Flag Value>:<Leaf Rule Filter>]

Where,

<Peer Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. It is used to specify the level and the starting point of the aggregation/operation/walk.

<Flag Set Expression> is the expression which results in a flag set on which this operation is to be performed.

<Flag Value> is the logical value. It can be either True/Yes or False/No. It is used to count flags that match this value. The default value is True/Yes .

<Leaf Rule Filter> is the Rule Name to filter the non-qualified leaf flag. If specified, only rules ending with this Rule Name will be considered for the aggregation. If not specified, all rules at the specified level will be considered.

Example

$$FlagCountFromLevel:A1.B1:$MyFlagSet:Yes:B1

“*” is not applicable for this function.

If “?” is specified as the leaf rule filter, the leaf rules will be counted only once and duplicates will be ignored.

This function walks all the flags in the same level as that of the rule identifier specified, starting from the given rule identifier. To consider all rules at a certain level, specify the identifier of the first rule in that level.

Function – FlagGetDescription

You can use the function FlagGetDescription to get a String description for the given Rule Identifier. It returns a string type.

Syntax

$$FlagGetDescription:<Rule Identifier>:<Flag Set Expression>

< Rule Identifier > is a constant identifier or an expression that results in a rule identifier which is in dotted notation.

<Flag Set Expression> is the expression which results in a flag set. It is used to identify the Rule Set from which the rule description is to be obtained.

Example

$$FlagGetDescription:A1:$MyFlagSet

“*” is not applicable for this function.

It returns a description string associated with the rule identifier.

Function – FlagsListDescription

You can use the function FlagsListDescription to get the list of string descriptions of all immediate child rules for the parent rule identifier passed, separated by the given character. It returns a string type.

Syntax

$$FlagsListDescription:<Parent Rule Identifier>:<Flag Set Expression>: [<Flag Value>:<Separator Character>]

Where,

<Parent Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. It is the parent rule name.

<Flag Set Expression> is the expression which results in a Flag Set on which the operation is to be performed. It is also used to identify the Rule Set from which the rule descriptions are to be obtained.

<Flag Value> is the logical value. It can be either True/Yes or False/No. It is used to get descriptions of flags that match this value. The default value is True/Yes .

<Separator Character> is a string value to separate string descriptions. If not specified, the default separator is used.

Example

$$FlagsListDescription:A1:$MyFlagSet:Yes:”,”

It considers all immediate child rules which match the flag value passed. ”*” can be passed as the parent rule identifier to get the descriptions from the rules in the first level.

Function – FlagsListDescriptionFromLevel

You can use the function FlagsListDescriptionFromLevel to get a list of unique string descriptions for the set of rules/flags from a given level, across parents that match the flag value passed. It returns a string type.

Syntax

$$FlagsListDescriptionFromLevel:<Peer Rule Identifier>:<Flag Set Expression>:[<Flag Value>:<Separator Character>]

Where,

<Peer Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. It is used to specify the level and the starting point of the aggregation/operation/walk.

<Flag Set Expression> is the expression which results in a Flag Set on which the operation is to be performed. It is also used to identify the Rule Set from which the rule descriptions are to be obtained.

<Flag Value> is the logical value. It can be either True/Yes or False/No. It is used to get descriptions of flags that match this value. The default value is True/Yes .

<Separator Character> is a string value to separate string descriptions. If not specified, the default separator is used.

Example

$$FlagsGetDescriptionListFromLevel:A1.B1:$MyFlagSet:Yes:”,”

In the above example, all descriptions at the level of rule A1.B1 and starting from the rule A1.B1 will be considered. However, a description will be considered only once. Rule A1.B1 and A2.B1 will refer to the same description, (i.e., description of Rule B1, assuming in both cases B1 is referring to same rule) but the description will be taken only once.

Function – AsFlagSet

You can use the function AsFlagSet to convert a Num Set to a Flag Set which allows the use of all Flag Set functions. It creates an equivalent Flag Set considering all non-zero numbers as True, and zero numbers as False.

Syntax

$$AsFlagSet:<Num Set Expression>

Where,

<Num Set Expression> is the expression evaluates to a Num Set value.

Example

$$AsFlagSet:$MyNumSet

This conversion leads to a loss of count information in the resultant flag set. True value in the flag set only represents a non-zero value in the original num set. However, the exact value cannot be obtained.

Data Type – Num Set

The data type Num Set stores and operates a set of numbers. This is a variable-length data type and hence has no restriction on the number of values that it can hold.

This data type is not directly input-able by the user and not directly displayable to the user.

The following Num Set functions help you to perform the operations on Num Set data type.

Function – NumGetValue

Use the function NumGetValue to get a value inside a Num Set. It returns a number type.

Syntax

$$NumGetValue:<Rule Identifier>:<NumSet Expression>

Where,

<Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation.

<Num Set Expression> is the expression that evaluates to a Num Set from which the number is to be fetched.

Example

$$NumGetValue:A1.B2:$MyNumSet

”*” helps to extract the master aggregate value (Zeroth num value) of the rule set.

Function – AsNumSet

You can use the function AsNumSet to convert a Flag Set to a Num Set.

Syntax

$$AsNumSet:<Flag Set Expression>

Where,

<Flag Set Expression> is any expression of Flag Set data type.

Example

$$AsNumSet:$MyFlagSet

It creates an equivalent Num Set by considering all False values as zero, and True as one.

The Num Set generated by this function will contain only 0s and 1s.

 

 

Post a Comment