You are on page 1of 4

;; program: tdl44.

txt
;; author : shweta computers
;;
;; objective:- adding filter button to mydaybook
;;======================================================================

;;global formula. used to assign a simple text string to a global constant.


[system: formula]
mydbktdl: $$localestring:"daybook"

;;add a new menu-item to the gateway of tally


[#menu: gateway of tally]
item: @@mydbktdl : display: my dbktdl

;;control whether the menu-option is displayed or not?


control: @@mydbktdl: $$allow:display:daybook

;; syntax for $$allow


;; $$allow : <mode> : <family report name>
;; return value : logical

[report: mydbktdl]

family: $$translate:"daybook"
;; the attribute family specifies that this report (i.e. mydbktdl)
;; belongs to a family (report) named daybook.
;; daybook is a pre-defined report and here we are specifying that
;; mydbktdl report belongs to the same daybook family.
;; this will affect access to mydbktdl report.
;; now, when we change the access to daybook report using option
;; "gateway of tally -> alt+f3 -> security features".
;; it will automatically affect the report mydbktdl

title: $$localestring:"daybook"
form : my form

;;variables used in the report


variables: svfromdate,svtodate,svsortmethod
variables: explodeflag, explodenarrflag
variables: onlyaccvouchers,onlyinvvouchers

set: sv sortmethod : @@default


set: svfromdate: $$monthstart:##svcurrentdate
set: svtodate: $$monthend:##svcurrentdate

;;required for f12 configuration


repeat: svcolumntype, svcolumnname

;;printset affects the variables related to printing, whereas


;;set is used to assign values to variables used otherwise.
printset: reporttitle: $$localestring:"daybook"
printset: printfilename: "daybook"

[form: my form]

;;pre-defined button. adds the print button


button: printbutton
;;explodeflag is a pre-defined button in default tally.
;;try using key instead of button, alt+f1 still works,
;;but the "alt+f1" button is not displayed
button: explodeflag

;;pre-defined button. required for f12 configuration


button: dybkconfigure

;;pre-defined button. filter records using alt+f12 key


button: filterbutton

space top : if $$inprintmode then ##svspacetop else 0.05 inches


space bottom: if $$inprintmode then 0.5 else 0.05 inches
space left : if $$inprintmode then 0.5 else 0.05 inches
space right : if $$inprintmode then 0.25 else 0.05 inches

part: my db title,my db body

[part: my db title]

;;optional parts
option: my db prnttitle : $$inprintmode
option: my db scrtitle : not $$inprintmode

[!part: my db prnttitle]

;;this is a pre-defined part in default tdl


use: dsp acctitles

[!part: my db scrtitle]
line: my db title

[line: my db title]
field : name field
local : field : name field : set as : $$localestring:"daybook"

[part: my db body]
line: my line
scroll: vertical
common border: yes
repeat : my line: my collection

[line: my line]
left fields: myfld1,myfld2
right fields: myfld3,myfld4

;;this shows the ledger details when alt+f1 key is pressed


explode: myexplodepart : ##explodeflag

[field: myfld1]
;;type attribute specifies the data-type of the field
type : date
set as : $date

[field: myfld2]
use : name field
set as : $$collectionfield:$ledgername:1:allledgerentries
[field: myfld3]
use : short name field
set as : $vouchertypename

[field: myfld4]
use : amount field
set as : $amount

;;important:-
;;this part is displayed when explodeflag variable is set to yes
;;i.e. when user presses alt+f1 key
[part: myexplodepart]
line : myexplodline
line : myexplodenarrline

;;repeats the line myexplodeline to display the allledgerentries


;;collection fields
repeat : myexplodline : allledgerentries

;; specify the fields that you wish to display when the part is exploded
[line: myexplodline]

;;show this field on the left side of the line


add: left fields: fldexplodeledger,fldexplodeamount

;;this skips the first object of collection allledgerentries


empty: $$isfirstobj

;;ledger name field


[field: fldexplodeledger]
indent : 10
use : name field
set as : $ledgername
style : small italic
width : @@namewidth

;;amount field
[field: fldexplodeamount]
use : amount field
set as : $amount
style : small italic
width : @@shortwidth

;; line to display narration


[line: myexplodenarrline]
add: left fields: fldexplodenarration

;;display narration field


[field: fldexplodenarration]
indent : 12
use : name field
set as : $narration
style : small italic
width : @@namewidth

;;collection definition
[collection: my collection]
type: voucher
;; notes:-
;; 1) this program is an extension of program tdl43.txt
;;
;; 2) herein, we have added filter button to the mydaybook report.
;; to filter records, press alt+f12

You might also like