CITY AND DISTRICT NAMES COLLECTION IN LEDGER

Discussion in 'Tally Integration' started by teja varma, Jan 7, 2020.

         
  1. teja varma

    teja varma Active Member


    ;; Free code ;;;for learning ;;; try it yourself;;;;;;;;;

    ->CITY Names and District Names Table for Selection
    ->Copy the Areas.xml (Unzip Areas.rar) file attached below and paste it in tally folder..
    ->Load the below TDL Source
    Code:
    
    [Collection:AreasXMLCollection]
        Data Source:File XML:"Areas.xml"
        XML Object Path: AREAOBJECT : 1 : AREACOLLECTION
        Client Only:Yes
    
    [Collection:AreasXMLSUBCollection]
        Source Collection:AreasXMLCollection
        Compute:CITY:$CITY
        Compute:CODE:$CODE
        Compute:STATE:$STATE
        Compute:DIST:$DIST
    
    
    [Collection:CITYNAMEXMLCOLL]
        Title:$$LocaleString:"List Of Cities"
        Source Collection:AreasXMLSUBCollection
        Full Height:Yes
        Align:Right
        Fetch:CITY
        Format:$CITY,40
        Unique:$CITY
    
    [Collection:DISTNAMEXMLCOLL]
        Title:$$LocaleString:"List Of Districts"
        Source Collection:AreasXMLSUBCollection
        Full Height:Yes
        Align:Right
        Fetch:DIST
        Format:$DIST,40
        Unique:$DIST
    
    [#Part: LED Mailing Address]
        Add:Bottom Line:At End:LEDAREALINE
    
    [Line:LEDAREALINE]
        Fields:MediumPrompt,LEDCITYINP,ShortPrompt,LEDISTINP
        Local:Field:MediumPrompt:Set as:$$LocaleString:"City"
        Local:Field:MediumPrompt:Width:8
        Local:Field:ShortPrompt:Set as:$$LocaleString:"District"
        Local:Field:ShortPrompt:Width:8
        Invisible:NOT ($$IsGroupSundryCreditors:$_PrimaryGroup or $$IsGroupSundryDebtors:$_PrimaryGroup)
    
    
    [Field:LEDCITYINP]
        Use:Name Field
        Storage:LEDCITYINP
        Background:white
        Table:CITYNAMEXMLCOLL,Not Applicable
        Show Table:On Empty
    
    [Field:LEDISTINP]
        Use:Name Field
        Storage:LEDISTINP
        Background:white
        Table:DISTNAMEXMLCOLL,Not Applicable
        Show Table:On Empty
    
    [System:UDF]
        LEDCITYINP:String:1234
        LEDISTINP:String:1677
        



    EDIT:
    on 11-1-20
    * Format : DIST,40 - > Format:$DIST,40

    hope it is useful..
     

    Attached Files:

    Last edited: Jan 11, 2020


  2. sattam

    sattam Active Member


    It shows damaged
     


  3. teja varma

    teja varma Active Member



  4. A Sam

    A Sam Member


    How to restrict District based on state and city based on district?

    Thanks
     


  5. Jenny

    Jenny Active Member



  6. A Sam

    A Sam Member


    change Format:DIST,40
    to
    Format:$DIST,40
     
    Jenny likes this.


  7. teja varma

    teja varma Active Member


    user filter in collection
     


  8. A Sam

    A Sam Member



    Could you please help with the code

    Very new to this
     


  9. anish

    anish Member


    Thank very much for sharing wonderful code !
     


  10. Jenny

    Jenny Active Member



  11. Jenny

    Jenny Active Member


    You can select city name automatic district fill-up.....

    Code:
    [Collection:AreasXMLCollection]
        Data Source:File XML:"Areas1.xml"
        XML Object Path: AREAOBJECT : 1 : AREACOLLECTION
        Client Only:Yes
    [Collection:CITYNAMEXMLCOLL]
        Title:$$LocaleString:"List Of Cities"
        Source Collection:AreasXMLCollection
        Full Height:Yes
        Align:Right
        Fetch:CITY,DIST
        Format:$CITY,20
        Format:$DIST,20
        Unique:$CITY
       
    [#Part: LED Mailing Address]
        Add:Bottom Line:At End:LEDAREALINE
    [Line:LEDAREALINE]
        Fields:MediumPrompt,LEDCITYINP,ShortPrompt,LEDISTINP
        Local:Field:MediumPrompt:Set as:$$LocaleString:"City"
        Local:Field:MediumPrompt:Width:8
        Local:Field:ShortPrompt:Set as:$$LocaleString:"District"
        Local:Field:ShortPrompt:Width:8
        Invisible:NOT ($$IsGroupSundryCreditors:$_PrimaryGroup or $$IsGroupSundryDebtors:$_PrimaryGroup)
    
    
    [Field:LEDCITYINP]
        Use:Name Field
        Storage:LEDCITYINP
        Table:CITYNAMEXMLCOLL,Not Applicable
        Show Table:On Empty
    [Field:LEDISTINP]
        Use:Name Field
        Storage:LEDISTINP
        Set Always:Yes
        Set as:$$FilterValue:$DIST:CITYNAMEXMLCOLL:1:DISTFILTER
        Skip : Yes
       
    [System:Formulae]
        DISTFILTER:$CITY = #LEDCITYINP
    
    [System:UDF]
        LEDCITYINP:String:1234
        LEDISTINP:String:1677
     

    Attached Files:



  12. anish

    anish Member


    Thank You Jenny Mam for sharing your knowledge !
     


Share This Page