Button working but Report not Auto-refreshing

Discussion in 'Tally Developer' started by Amit Kamdar, Aug 26, 2018.

    
  1. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Dear Experts,

    Have made a Toggle Button to sort Report on Cond1 and Cond2........

    It is working, however after pressing the button I have to refresh the TDL/Report.

    Any Ideas??? Why and How?
     
    Jaydeep Shah likes this.


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    The code is as below:

    Also in Report I have set...........

    Set : SortChange : "SortDays"


    Code:
    [Variable : SortChange]
        Type        : String
        Default        : "SortName"
        Volatile    : No
    
    [System : Variable]
        SortChange    : SortName
    
    [Key : Sorting]
        Key        : F4
        Title        : If ##SortChange = "SortDays" Then "Sort on Days" Else "Sort on Item"
        Action        : Set : SortChange : If ##SortChange = "SortDays" Then "SortName" Else "SortDays"
    
     
    Jaydeep Shah likes this.


  3. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Do I have to make a FUNTION ???
     


  4. Jaydeep Shah

    Jaydeep Shah Member


    Hi,

    i think you must be calling these values in your collection. Collection is referred to in reports/field. therefore you need to refresh.
    Sorry am not able to help.

    JD
     


  5. sivam

    sivam Active Member


    Code:
    [Button: VFST Configure]
       
        Title        : "Sorting"
        Key            : F12
        Action        : Execute    : VFST Configure
    
    [Report: VFST Configure]
       
        Auto        : Yes
        Form         : VFST Configure
    [Form: VFST Configure]
       
        No confirm  : Yes
        Full width  : No
        Full height : No
        Background  : @@SV_CMPCONFIG
        Local       : Style : Default       : Height        : @@SmallSize
        Local       : Line  : Form SubTitle : SpaceBottom   : 0.5
        Parts         : VFST Sorting
    
    [Part: VFST Sorting]
       
        Lines         : DSP Sorting
    In Collection Level
    Sort : <Sorting Name> : <Object Name>

    First Sort Name Should be use @@Default
     
    vinoth likes this.


  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Code:
    [Collection: Expiry]
        Use        : ExpirySrc
        Compute     : RemainingDays :($$Date:$Expiryperiod) - ($$Date:#SVToDate)
        Compute     : GodownName : $GodownName
        Sort        : @@Default  : @@newsort
    
    [System : Formula]
        NewSort        : If ##SortChange = "SortName" then $RemainingDays Else $Name
    
    [Variable : SortChange]
        Type        : String
        Default        : $$String:"SortName"
        Volatile    : No
    [System : Variable]
        SortChange    : "SortName"
    [Key : SortChange]
        Key        : F5
        Title        : If ##SortChange = "SortDays" Then "Sort on Days" Else "Sort on Item"
        Action    : Set     : SortChange : If ##SortChange = "SortDays" Then "SortName" Else "SortDays" 
    
    
    In Report level ---> Variable : SVSortMethod

    It does not work.......Is it because it is a toggle button? You example code is straight action type....mine is toggle.
     


  7. sivam

    sivam Active Member



    I Say Like this. You can Set That Variable Value Based in Toggle Type Also.

    [Collection: Expiry]
    Use : ExpirySrc
    Compute : RemainingDays :($$Date:$Expiryperiod) - ($$Date:#SVToDate)
    Compute : GodownName : $GodownName
    Sort : @@Default : $Name
    Sort : "Sort on Days" : $RemainingDays
     
    vinoth likes this.


  8. RAJdon

    RAJdon New Member


    Define the Variable in Report Level, and Set the Varaable with default load value

    if u do this, after this button will work fine
     


  9. balajimg

    balajimg Active Member


    [Variable : SortChange]
    Type : String
    Default : "SortName"
    Volatile : No

    [System : Variable]
    SortChange : SortName

    [Key : Sorting]
    Key : F4
    Title : If ##SortChange = "SortDays" Then "Sort on Days" Else "Sort on Item"
    Action : Set : SortChange : If ##SortChange = "SortDays" Then "SortName" Else "SortDays"

    ;;replace action with the following

    ACtion : Call : SortRefresh : ##SortChange

    [Function : SortRefresh]
    Parameter : SortString : String

    Variable : SortChange : String

    01 : Set : SortChange : If ##SortString = "SortDays" Then "SortName" Else "SortDays"
    02 : Refresh TDL
    03 : Refresh Data
     


  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Thank you for your solution....but it did not work either.......

    Is there any way to write a function.... that after pressing F4 button...... the function gets called to refresh TDL and data.

    I saw similar function in Developer during making of another project TDL, but am unable to locate it or recollect it. I think Tally called it dummy condition to refresh data with new user input parameters.

    I will appreciate it. Thanks in advance.
     


  11. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    In Report level...already done...........
    Set : SortChange : "SortName"
    Variable : SortChange
     


  12. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    A little bit of tweaking...... this worked........ Many thanks to all for your assistance.

    [Button : SortChange]
    Key : F5
    Title : If ##SortChange = "SortDays" Then "Sort on Days" Else "Sort on Batches"
    Action : Call : SortRefresh

    [Function : SortRefresh]
    01 : Set : SortChange : If ##SortChange = "SortDays" Then "SortName" Else "SortDays"
    02 : Refresh TDL
    03 : Refresh Data
     


  13. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Still cannot understand the logic.........

    I have 4 toggle buttons in this report.........
    Sorting on Name or Days
    Hide/Show Category
    Hide/Show Group
    Persishable and All Stocks

    All toggle works fine except the sorting. And why did it require a function to REFRESH??

    Is it because this Condition was connected to a COLLECTION??
     


  14. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    This also worked......... introduced a Dummy collection to refresh data.

    [Collection: Expiry]
    Use : ExpirySrc
    Compute : RemainingDays :($$Date:$Expiryperiod) - ($$Date:#SVToDate)
    Compute : GodownName : $GodownName
    Filter : NonZeroClBal
    Sort : @@Default : @@NewSort
    Option : Dummyrefresh : ##SortChange OR NOT ##SortChange

    [!Collection : Dummyrefresh]
     


  15. balajimg

    balajimg Active Member


    True
    Sometimes collection doesn't refresh
     


Share This Page