Import From Excel To Aggregate Field

Discussion in 'Tally Developer' started by Naitesh, Sep 9, 2018.

  1. Naitesh

    Naitesh Member


    thank you all of you for your time to reply
    Hello Sir
    I have tried this to understand this function
    but something wrong

    please correction
    thank you sir

    [System: UDF]
    MyUdfStkMasterTBL1 : Aggregate : 20025
    MyUdfStkItemName1 : String : 20026
    MyUdfStkItemCat1 : String : 20027

    [#Menu: Accounts Info.]
    Add: Item :Before :mad:@locQuit:Import Stock From Excel:Call : TestFunction123
    Add: Item :Before :mad:@locQuit:Display Imported Stock :Alter:Stock Detail Master

    [Report:Stock Detail Master]
    Form: STForm
    Title: "Stock Detail Master"
    Object:company

    [Form: STForm]
    Width: 100% Screen
    Height: 100% Screen
    Background: FormClr
    Part:STPart

    [Part:STPart ]
    Line: STLineTitle,STLine
    Repeat:STLine:MyUdfStkMasterTBL1
    Break on : $$IsEmpty:$MyUdfStkItemName1
    Scroll: Vertical

    [Line:STLineTitle]
    Fields : TLSTSrNoFld, TLSTNameFld,TLSTCat
    Local : Field : Default : Delete : Border

    [Line:STLine]
    Fields : Multi SNo, STNameFld,STCatFld
    Local : Field : Default : Delete : Border

    [Field: TLSTSrNoFld]
    Use: Name Field
    Set as: "Sr"
    Width: 4
    Align: Center
    Color: BLUE

    [Field: TLSTNameFld]
    Use: Name Field
    Set as: "Stock Name"
    Width: 30
    Align: Left
    Color: BLUE

    [Field: STNameFld]
    Use : Name Field
    Storage : MyUdfStkItemName1
    Width: 30

    [Field: TLSTCat]
    Use: Name Field
    Set as: "Stock Color"
    Width: 30
    Align: Left
    Color: BLUE

    [Field: STCatFld]
    Use : Name Field
    Storage : MyUdfStkItemCat1
    Width: 30

    [Collection : NSCollimport]
    ODBC : "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=D:\NExSubManual1.xlsx"
    SQL : "Select * from [Sheet1$]"

    [Function : TestFunction123]
    10 : WALK COLLECTION : NSCollimport
    30 : INSERT COLLECTION OBJECT : MyUdfStkMasterTBL1
    40 : Set Value : MyUdfStkItemName : $_1
    50 : Set Value : MyUdfStkItemColor : $_2
    60 : Set Object Values
    70 : SET TARGET : ..
    80 : Accept Create
    100 : END Walk
    120: MSGBOX : "Status" : "Stock Item-Type Imported"
     

    Attached Files:



  2. RAJdon

    RAJdon New Member


    [Function : TestFunction123]
    Object : Company : ##SVCurrentCompany

    01 : SET TARGET

    10 : SET TARGET

    10 : WALK COLLECTION : NSCollimport
    30 : INSERT COLLECTION OBJECT : MyUdfStkMasterTBL1
    40 : Set Value : MyUdfStkItemName : $_1
    50 : Set Value : MyUdfStkItemColor : $_2
    60 : Set Object Values
    70 : SET TARGET : ..
    100 : END Walk

    120 : SET TARGET : ..

    130 : ACCEPT ALTER


    120: MSGBOX : "Status" : "Stock Item-Type Imported"



    ;;;; Try This
     


  3. Naitesh

    Naitesh Member


    Sir I Tried but Not Save data
    thank you very much for your time to reply
    please help me to correct function
     



  4. i add this blue line on my code its word nice

    Object : Company : ##SVCurrentCompany

    01 : SET TARGET

    02 : SET TARGET



    VARIABLE: Total: Number
    VARIABLE: Count: Number

    00: SET: Total: $$Min:10:$$NumItems:p8015EXCELOPEN
    10: IF: $$IsEmpty:##Total
    20: MSG BOX: "Error": "No data to import!"
    30: RETURN
    40: END IF

    50: START PROGRESS: ##Total: @@P8015NAME: "Import": ##SVCurrentCompany
    60: SET: Count: 0

    70: WALK COLLECTION: P8015EXCELOPEN
    80: IF: ##Count >= 10
    90: BREAK
    100: END IF

    110: IF: $$IsEmpty:$_1
    120: CONTINUE
    130: END IF
    135: LOG: $_1
    136 : LOG:$_2

    140: SET TARGET: Company :##SVCurrentCompany
    150: INSERT COLLECTION OBJECT: reportv320vs1
    160: SET VALUE: reportv320vs2 : $_1
    170: SET VALUE: reportv320vs3 : $_2


    70x : SET TARGET : ..
    180: INCREMENT: Count
    190: SHOW PROGRESS: ##Count
    100x : END Walk

    120x : SET TARGET : ..

    130x : ACCEPT ALTER




    210: END PROGRESS
     


Share This Page