User Login Report

Discussion in 'Free Source Codes' started by Rohit Khedar, Nov 28, 2019.

         
  1. Rohit Khedar

    Rohit Khedar Member


    ;; I want Create User Login Report but not success so help plz

    [#Menu : Gateway of Tally]

    Item : My Reports : Display : Login Report : NOT $$IsEmpty:$$SelectedCmps


    [Style: Normaluser]

    Use : Normal Bold
    Height : 12
    Italic : Yes

    ;;=============================== Login Report ===================================;;

    [Report : Login Report]

    Form : Login Report

    [Form : Login Report]

    Part : Log formTitle, Log Title,;; Log formDetail

    Horizontal Align: Center
    Vertical Align : Top

    Height : 60% Screen
    Width : 70% Screen



    [Part: Log formTitle]
    Lines :Log formTitle
    Space Bottom : 0.5

    [Line: Log formTitle]

    Field: Form Sub Title

    Local : Field : Form Sub Title : Set as : "User Login Report"
    Local : Field : Form Sub Title : Align : Center
    Local : Field : Form Sub Title : Fullwidth : yes
    Local : Field : Form Sub Title : Color : Blue
    Local : Field : Form Sub Title : Border: Thin Bottom
    Local : Field : Form Sub Title : Style: Normaluser


    [Part : Log Title]
    Line : Log Title_A, Log Title_B
    Repeat : Log Title_B :Log Title Coll
    Break On : $$IsEmpty:$Logname
    Scroll : Vertical
    Common Borders : Yes
    Border : Thin Bottom

    [Line : Log Title_A]
    Use: Log Title_B

    Local : Field : Default : Background : yellow
    Local : Field : Default : Color : Blue
    Local : Field : Default : Align : Center
    Local : Field : Default : Style: Normal Bold Italic

    Local : Field : Logname : Info : "User Name"
    Local : Field : Logcompname : Info : "Company"
    Local : Field : Logstatus : Info : "Status"
    Local : Field : Logdat : Info : "Login Date"
    Local : Field : Logtim : Info : "Login Time"
    Border : column Titles



    [Line : Log Title_B]

    Field : Logname, Logcompname
    Right Field : Logstatus, Logdat, Logtim

    [Field : Logname]

    Use : Name Field
    Set as : $$CmpUserName
    Set Always : Yes
    Width : 15
    Border : Thin Left
    Skip : Yes

    [Field : Logcompname]

    Use : Name Field
    Set as : $$OwnerCompany
    Width : 25
    Border : Thin Left

    [Field : Logstatus]

    Use : Name Field
    Set as : "Login"
    Width : 15
    Border : Thin Left

    [Field :Logdat]

    Use : Uni Date Field
    Set as : $$String:$MachineDate
    Width : 15
    Border : Thin Left

    [Field :Logtim]

    Use:Name Field
    Align : Right
    Set as :$$String:$$MachineTime
    Width : 15
    Border : Thin Left Right


    [Collection: Log Title Coll]

    Type : Company
    Fetch : UserName , CompanyName, Date, Time

    Compute : Owner Company : $$LoopCollObj:$Name
     


  2. gangstar

    gangstar Member


    ;; Little Bit i changed Bro

    [#Menu : Gateway of Tally]
    Item : My Reports : Display : Login Report : NOT $$IsEmpty:$$SelectedCmps
    [Style: Normaluser]
    Use : Normal Bold
    Height : 12
    Italic : Yes

    ;;=============================== Login Report ===================================;;

    [Report : Login Report]
    Form : Login Report

    [Form : Login Report]
    Part : Log formTitle, Log Title,;; Log formDetail
    Horizontal Align: Center
    Vertical Align : Top
    Height : 60% Screen
    Width : 70% Screen

    [Part: Log formTitle]
    Lines :Log formTitle
    Space Bottom : 0.5

    [Line: Log formTitle]
    Field: Form Sub Title
    Local : Field : Form Sub Title : Set as : "User Login Report"
    Local : Field : Form Sub Title : Align : Center
    Local : Field : Form Sub Title : Fullwidth : yes
    Local : Field : Form Sub Title : Color : Blue
    Local : Field : Form Sub Title : Border: Thin Bottom
    Local : Field : Form Sub Title : Style: Normaluser

    [Part : Log Title]
    Line : Log Title_A, Log Title_B
    Repeat : Log Title_B :Log Title Coll
    Break On : $$IsEmpty:$Logname
    Scroll : Vertical
    Common Borders : Yes
    Border : Thin Bottom

    [Line : Log Title_A]
    Use: Log Title_B
    Local : Field : Default : Background : yellow
    Local : Field : Default : Color : Blue
    Local : Field : Default : Align : Center
    Local : Field : Default : Style: Normal Bold Italic
    Local : Field : Logname : Info : "User Name"
    Local : Field : Logcompname : Info : "Company"
    Local : Field : Logstatus : Info : "Status"
    Local : Field : Logdat : Info : "Login Date"
    Local : Field : Logtim : Info : "Login Time"
    Border : column Titles

    [Line : Log Title_B]
    Field : Logname, Logcompname
    Right Field : Logstatus, Logdat, Logtim

    [System:UDF]
    Logname:String:2810
    Logcompname:String:2811
    Logstatus:String:2812
    Logdat:Date:2813
    Logtim:String:2814

    [Field : Logname]
    Use : Name Field
    Set as : $$CmpUserName
    Set Always : Yes
    Width : 15
    Border : Thin Left
    Skip : Yes
    Storage:Logname

    [Field : Logcompname]
    Use : Name Field
    Set as : @@cmpmailname;$$OwnerCompany
    Width : 25
    Border : Thin Left
    Storage:Logcompname

    [Field : Logstatus]
    Use : Name Field
    Set as : "Login"
    Width : 15
    Border : Thin Left
    Storage:Logstatus

    [Field :Logdat]
    Use : Uni Date Field
    Set as : $$String:$MachineDate
    Width : 15
    Border : Thin Left
    Storage:Logdat

    [Field :Logtim]
    Use:Name Field
    Align : Right
    Set as :$$String:$$MachineTime
    Width : 15
    Border : Thin Left Right
    Storage:Logtim

    [Collection: Log Title Coll]
    Type : Company
    Fetch : UserName , CompanyName, Date, Time
    Compute : Owner Company : $$LoopCollObj:$Name
     


  3. Rohit Khedar

    Rohit Khedar Member


    thanks for hlp and reply but bro when tally close and again open tally then 1st login repot delete
     


  4. gangstar

    gangstar Member


    Sorry Bro i dont know how 2 save last history of user login report...
     


  5. Rohit Khedar

    Rohit Khedar Member


    any expert solvd plz how save last login entry in report
     


  6. Rohit Khedar

    Rohit Khedar Member


    any expert solvd plz how save last login entry in report
     


  7. lumos

    lumos Member


    I tried solving it , but for some reason the values are not reflected. Theorotically I have done everything right.
    Update :Updated working code and Added Date filter.

    Code:
    [System: Events]
    LogloadEvent:Load Company:NOT $$IsRemoteCompany    :Call:lGOpFUNC
    
    
    [#Menu : Gateway of Tally]
    Item : My Reports : Display : Login Report : NOT $$IsEmpty:$$SelectedCmps
    
    [Style: Normaluser]
    Use : Normal Bold
    Height : 12
    Italic : Yes
    
    ;;=============================== Login Report ===================================;;
    
    [Report : Login Report]
    Form : Login Report
    Variable:SVCurrentDate
    
    [Form : Login Report]
    Part :  Log Title
    Vertical Align : Top
    Height : 60% Screen
    Width : 40% Screen
    Button:Change Date
    Set       : SVCurrentDate : $$Machinedate
    
    
    [Part: Log formTitle]
    Lines :Log formTitle
    Space Bottom : 0.5
    Scroll : Vertical
    
    [Line: Log formTitle]
    Field: Form Sub Title
    Local : Field : Form Sub Title : Set as : "User Login Report"
    Local : Field : Form Sub Title : Align : Center
    Local : Field : Form Sub Title : Fullwidth : yes
    Local : Field : Form Sub Title : Color : Blue
    Local : Field : Form Sub Title : Border: Thin Bottom
    Local : Field : Form Sub Title : Style: Normaluser
    
    [Part : Log Title]
    Line : Log Title_A, Log Title_B
    Break On : $$IsEmpty:$LGname
    Scroll : Vertical
    Common Borders : Yes
    Border : Thin Bottom
    Repeat:Log Title_B: Log Title Coll
    
    [Line : Log Title_A]
    Field:LGnametit, Lgcompnametit,Lgstatustit, Lgdattit, Lgtimtit
    Local : Field : Default : Background : yellow
    Local : Field : Default : Color : Blue
    Local : Field : Default : Align : Center
    Local : Field : Default : Style: Normal Bold Italic
    Local : Field : Default : Delete :Storage
    Border : column Titles
    
    [Field : LGnametit]
    Use : Name Field
    Info : "User Name"
    Width: 15
    
    
    [Field : Lgcompnametit]
    Use : Name Field
    Info : "Company"
    Width : 25
    
    
    [Field : Lgstatustit]
    Use : Name Field
    Info : "Status"
    Width : 15
    
    
    [Field :Lgdattit]
    Use : Uni Date Field
    Info : "Login Date"
    Width : 15
    
    
    [Field :Lgtimtit]
    Use:Name Field
    Align : Right
    Info : "Login Time"
    Width : 15
    
    
    
    [Line : Log Title_B]
    Field : LGname, Lgcompname,Lgstatus, Lgdat, Lgtim
    
    [Field : LGname]
    Use : Name Field
    Set as : $LGname
    Width : 15
    Border : Thin Left
    
    [Field : Lgcompname]
    Use : Name Field
    Set as : $Lgcompname
    Width : 25
    Border : Thin Left
    
    [Field : Lgstatus]
    Use : Name Field
    Set as : $Lgstatus
    Width : 15
    Border : Thin Left
    
    [Field :Lgdat]
    Use : Uni Date Field
    Set as : $Lgdat
    Width : 15
    Border : Thin Left
    
    [Field :Lgtim]
    Use:Name Field
    Align : Right
    Set as :$Lgtim
    Width : 15
    Border : Thin Left Right
    
    
    [Collection: Log Title Coll]
    Type         : LgAgg  : Company
    Childof     : ##SVCurrentCompany
    Fetch         : *, *.*
    Filter: DateFil
    
    [System: Formulae]
        DateFil: $lgdat = ##SVCurrentDate
    [System:UDF]
    LgAgg        :Aggregate    :    2962
    LGname        :String        :    1561
    Lgcompname    :String        :    1562
    Lgstatus    :String        :    1563
    Lgdat        :Date        :    1564
    Lgtim        :String        :    1565
    
    [Function: lGOpFUNC]
        01:Call: logOpfunc
        ;02:Call: forlog
    
    [Function: LogOPFunc]
        Variable    :    Usname    :String
        Variable    :    comname    :String
        Variable    :    lgstat    :String
        Variable    :    lgdat    :Date
        Variable    :    lgtim    :String
    
        Object    : Company : ##SvCurrentCompany
    
        010    : Set Target
        020    :    Set:Usname:##SVUserName
        030    :    Set:comname:@@cmpmailname
        040    :    Set:lgstat: $$LocaleString:"Login"
        050    :    Set:lgdat:$$Date:$$MachineDate
        060    :    Set:lgtim:$$String:$$MachineTime
    
        080    :    Insert Collection Object:LgAgg
        090    :        Set Target:LgAgg
        110    :        Set Value:LGname:##usname
        120    :        Set Value:Lgcompname:##comname
        130    :        Set Value:Lgstatus:##lgstat
        140    :        Set Value:Lgdat:##lgdat
        150    :        Set Value:Lgtim:##lgtim
        160    :        Set Target..
        170    :     Set Target..
        175    :    Accept Alter
      
    
    [Function: forlog]
    
        00    : SET FILE LOG ON
        10    : WALK COLLECTION    : Log Title Coll
        15    :     LOG    : "Walk begins here --------------------"
        16    :         LOG    : "Name  : " +$LGname
        17    :         Log    : "Comp Name:" + $lgcompname
        18     :        Log    : "Status:" + $lgstatus
        19    :        Log    : "Date:" +$$String:$Lgdat
        20    :        Log    : "time:" + $$String:$lgtim
        125    :     LOG    : "Walk ends here   --------------------"
        130    : END WALK
        140    : EXEC COMMAND    : "TDLFunc.Log"
        180    : SET FILE LOG OFF
    
    
     
    Last edited: Dec 5, 2019


  8. Rohit Khedar

    Rohit Khedar Member


    lumos bhai thanks try for me but some problm .
     

    Attached Files:



  9. Rohit Khedar

    Rohit Khedar Member


    any expert solvd plz how save last login entry in report
     


  10. Kamlesh_Patel

    Kamlesh_Patel New Member


    Excellent Try
     


  11. garima

    garima Active Member


    Here it is.. how it works... try to write code in clean manner...

    try... try... try... and then again .. try...


    Thanks @lumos

    Code:
    [System: Events]
    LogEvent:Load Company:NOT $$IsRemoteCompany    :Call:lGFUNC
    
    [#Menu : Gateway of Tally]
    Item : My Reports : Display : Login Report : NOT $$IsEmpty:$$SelectedCmps
    
    [Style: Normaluser]
    Use : Normal Bold
    Height : 12
    Italic : Yes
    
    ;;=============================== Login Report ===================================;;
    
    [Report : Login Report]
    Form : Login Report
    
    [Form : Login Report]
    Part :  Log Title,;; Log formDetail
    ;Horizontal Align: Center
    Vertical Align : Top
    Height : 60% Screen
    Width : 40% Screen
    
    
    [Part: Log formTitle]
    Lines :Log formTitle
    Space Bottom : 0.5
    Scroll : Vertical
    
    [Line: Log formTitle]
    Field: Form Sub Title
    Local : Field : Form Sub Title : Set as : "User Login Report"
    Local : Field : Form Sub Title : Align : Center
    Local : Field : Form Sub Title : Fullwidth : yes
    Local : Field : Form Sub Title : Color : Blue
    Local : Field : Form Sub Title : Border: Thin Bottom
    Local : Field : Form Sub Title : Style: Normaluser
    
    [Part : Log Title]
    Line : Log Title_A, Log Title_B
    Break On : $$IsEmpty:$LGname
    Scroll : Vertical
    Common Borders : Yes
    Border : Thin Bottom
    Repeat:Log Title_B: Log Title Coll
    
    [Line : Log Title_A]
    Field:LGnametit, Lgcompnametit,Lgstatustit, Lgdattit, Lgtimtit
    Local : Field : Default : Background : yellow
    Local : Field : Default : Color : Blue
    Local : Field : Default : Align : Center
    Local : Field : Default : Style: Normal Bold Italic
    Local : Field : Default : Delete :Storage
    Border : column Titles
    
    [Field : LGnametit]
    Use : Name Field
    Info : "User Name"
    ;Border : Thin Left
    Width: 15
    ;Skip : Yes
    ;Storage:LGname
    
    [Field : Lgcompnametit]
    Use : Name Field
    Info : "Company"
    Width : 25
    ;Border : Thin Left
    ;Storage:Lgcompname
    
    [Field : Lgstatustit]
    Use : Name Field
    Info : "Status"
    Width : 15
    ;Border : Thin Left
    ;Storage:Lgstatus
    
    [Field :Lgdattit]
    Use : Uni Date Field
    Info : "Login Date"
    Width : 15
    ;Border : Thin Left
    
    [Field :Lgtimtit]
    Use:Name Field
    Align : Right
    Info : "Login Time"
    Width : 15
    ;Border : Thin Left Right
    
    
    [Line : Log Title_B]
    Field : LGname, Lgcompname,Lgstatus, Lgdat, Lgtim
    ;Right Field :
    
    [Field : LGname]
    Use : Name Field
    ;Set as : $LGname
    ;Set Always : Yes
    Width : 15
    Border : Thin Left
    ;Skip : Yes
    Storage:LGname
    
    [Field : Lgcompname]
    Use : Name Field
    Set as : $Lgcompname;$$OwnerCompany
    Width : 25
    Border : Thin Left
    ;Storage:Lgcompname
    
    [Field : Lgstatus]
    Use : Name Field
    Set as : $Lgstatus
    Width : 15
    Border : Thin Left
    ;Storage:Lgstatus
    
    [Field :Lgdat]
    Use : Uni Date Field
    Set as : $Lgdat
    Width : 15
    Border : Thin Left
    
    [Field :Lgtim]
    Use:Name Field
    Align : Right
    Set as :$Lgtim
    Width : 15
    Border : Thin Left Right
    
    
    [Collection: Log Title Coll]
    Type         : LgAgg  : Company
    Childof     : ##SVCurrentCompany
    Fetch         : *, *.*
    
    /*Fetch : UserName , CompanyName, Date, Time
    Compute : Owner Company : $$LoopCollObj:$Name*/
    
    
    [System:UDF]
    LgAgg        :Aggregate    :    2962
    LGname        :String        :    1561
    Lgcompname    :String        :    1562
    Lgstatus    :String        :    1563
    Lgdat        :Date        :    1564
    Lgtim        :String        :    1565
    
    [Function: lGFUNC]
        01:Call: logfunction
        ;02:Call: forlog
    
    [Function: Log Function]
        Variable    :    Usname    :String
        Variable    :    comname    :String
        Variable    :    lgstat    :String
        Variable    :    lgdat    :Date
        Variable    :    lgtim    :String
    
        Object    : Company : ##SvCurrentCompany
    
        010    : Set Target
        020    :    Set:Usname:##SVUserName
        030    :    Set:comname:@@cmpmailname
        040    :    Set:lgstat: $$LocaleString:"Login"
        050    :    Set:lgdat:$$Date:$$MachineDate
        060    :    Set:lgtim:$$String:$$MachineTime
    
        080    :    Insert Collection Object:LgAgg
        090    :        Set Target:LgAgg
    
        110    :        Set Value:LGname:##usname
        120    :        Set Value:Lgcompname:##comname
        130    :        Set Value:Lgstatus:##lgstat
        140    :        Set Value:Lgdat:##lgdat
        150    :        Set Value:Lgtim:##lgtim
        160    :        Set Target..
        170    :     Set Target..
    
        175    :    Accept Alter
    
    
    [Function: forlog]
    
        00    : SET FILE LOG ON
        10    : WALK COLLECTION    : Log Title Coll
        15    :     LOG    : "Walk begins here --------------------"
        20    :     LOG    : "Is First Object  : " + $$String:$$IsFirstObj
        30    :     LOG    : "Is Last Object   : " + $$String:$$IsLastObj
        40    :     LOG    : "First Object     : " + $$FirstObj:$LGname
        50    :     LOG    : "Last Object      : " + $$LastObj:$LGname
        60    :    IF    : NOT $$IsEmpty:$$PrevObj:$LGname
        70    :         LOG    : "Previous Object  : " + $$PrevObj:$LGname
        80    :    ENDIF
        90    :     LOG    : "Current Object   : " + $LGname
        100    :    IF    : NOT $$IsEmpty:$$NextObj:$LGname
        110    :         LOG    : "Next Object      : " + $$NextObj:$LGname
        120    :     ENDIF
        125    :     LOG    : "Walk ends here   --------------------"
        130    : END WALK
        140    : EXEC COMMAND    : "TDLFunc.Log"
        180    : SET FILE LOG OFF
     

    Attached Files:

    Last edited: Dec 5, 2019
    Frz, Vikram Bhat and Rohit Khedar like this.


  12. rmraja

    rmraja Member


    Feeling proud to be part of the forum and be with the helping heart, decide to learn tdl
    Great Members- every step is success!
     


  13. garima

    garima Active Member



    ha ha.. what is that ??

    Every step is just a step.. success is a state of mind.o_O
     


  14. Jay kumar tailor

    Jay kumar tailor Well-Known Member


    If Every Step Is Successful .
    Then you Will Be Richest And Mindest Man on Earth.

    Congratulations;):)
     
    garima likes this.


  15. lumos

    lumos Member


    Thankyou @garima sir I did not know indenting made a difference. you learn new things every day.
    Thankyou @Kamlesh_Patel I thought it was a nice concept hence tried correcting it.
     


  16. garima

    garima Active Member


    Yes It makes... if code is clean.. brain works faster.. :):)
     


  17. lumos

    lumos Member


    That plus Tally also was not interpreting it properly, after indenting it made a difference.
     


  18. Rohit Khedar

    Rohit Khedar Member


    thanks all help expert
     


  19. Jay kumar tailor

    Jay kumar tailor Well-Known Member


    Also Showing Previous Log in Company Username in Company Which Have no Security.
     


  20. Vikram Bhat

    Vikram Bhat Member


    Super sir
     


  21. sattam

    sattam Active Member


    is this function works for log out report?
     


  22. lumos

    lumos Member


    Tried implementing it but the data is not retained in the company.
     


  23. Eresh

    Eresh New Member


    Not working showing blank fields
     



  24. USER LOGING REPORT
     

    Attached Files:



  25. Rohit Khedar

    Rohit Khedar Member


    Very Nice, Share code
     


Share This Page