SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Senior Member
    Join Date
    Dec 2003
    Location
    Chennai
    Posts
    166
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to handle external data table ?

    i am handle external data table for my project.

    My code is

    ‘#############################################
    AppPath=Environment.Value ("TestDir")
    DataTable.Import AppPath & "\runplan.xls"
    DataTable.ImportSheet AppPath & "\runplan.xls" ,1,"Global"

    For i=1 to DataTable.GetRowCount
    ScrName=DataTable("ScrName",dtLocalSheet)
    If ScrName<>"" Then
    RunAction ScrName, oneIteration
    End If
    DataTable.SetNextRow
    Next
    ‘################################################# #

    This code is working sometime, sometime is not working………..
    What I have to do now, I have to Configure anything
    Please help me
    Thanks & Regards

    Marshal

  2. #2
    Senior Member
    Join Date
    Oct 2004
    Location
    Bangalore
    Posts
    270
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to handle external data table ?

    Hi,
    If you have only one sheet then no need to import the sheet once again i think..just import.datatable is fine....

    then u can use...
    ScrName=DataTable("ScrName",dtGlobalSheet)

    This is should work...

    mean to say the whol code may look like this..

    AppPath=Environment.Value ("TestDir")
    DataTable.Import AppPath & "\runplan.xls"

    For i=1 to DataTable.GetRowCount
    ScrName=DataTable("ScrName",dtGlobalSheet)
    If ScrName<>"" Then
    RunAction ScrName, oneIteration
    End If
    DataTable.SetNextRow
    Next

    Cheers
    Yogi

  3. #3
    Senior Member
    Join Date
    Dec 2003
    Location
    Chennai
    Posts
    166
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to handle external data table ?

    Hi Yogi

    My Code is

    DataTable.Import "d:\marshal\runplan.xls"
    DataTable.ImportSheet "d:\marshal\runplan.xls",2,"Action1"

    Msgbox DataTable.GetRowCount

    For i=1 to DataTable.GetRowCount
    ---------
    --------
    ----------
    DataTable.SetNextRow
    Next

    the runplan.xls having 20 rows......
    but I can get DataTable.GetRowCount value is 0
    why..?
    Thanks & Regards

    Marshal

  4. #4
    Senior Member
    Join Date
    Oct 2004
    Location
    Bangalore
    Posts
    270
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to handle external data table ?

    Hi,
    Try to import only datatable i.e
    DataTable.Import "d:\marshal\runplan.xls"
    DataTable.ImportSheet "d:\marshal\runplan.xls",2,"Action1" 'Not Required

    now u give the Msgbox DataTable.GetRowCount
    and c what happens....

  5. #5
    Senior Member
    Join Date
    Dec 2003
    Location
    Chennai
    Posts
    166
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to handle external data table ?

    if i am handle external data table.....that time

    what i have to select in Data Table iterations?

    1-Run one iteration only
    2-Run on all rows
    3-run from row

    but i selected option 2
    Thanks & Regards

    Marshal

  6. #6
    Senior Member
    Join Date
    Oct 2004
    Location
    Bangalore
    Posts
    270
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to handle external data table ?

    Hi,

    Select first option, that is Run one iteration only...this selection is for how much time u r script should run....

    depending on the data from u r excel sheet with the help of for loop u can iterate the required steps....think u got it...

    Cheers
    Yogi

  7. #7
    Senior Member
    Join Date
    Dec 2003
    Location
    Chennai
    Posts
    166
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to handle external data table ?

    Dear Yogi

    My Code

    Action1

    AppPath=Environment.Value ("TestDir")
    DataTable.Import AppPath & "\runplan.xls"
    DataTable.ImportSheet AppPath & "\runplan.xls" ,1,"Global"

    For i=1 to DataTable.GetRowCount

    ActionScrName=DataTable("ScrName",dtGlobalSheet) ' i will get Action Name

    If ActionScrName <>"" Then
    RunAction ActionScrName, oneIteration
    End If

    DataTable.SetNextRow
    Next

    -------------------------
    Action1 is working fine
    -----------------------

    Action2

    AppPath=Environment.Value ("TestDir")
    DataTable.Import AppPath & "\8054.xls"
    DataTable.ImportSheet AppPath & "\8054.xls",2,"Action1"

    Msgbox DataTable.GetRowCount

    -----------------------------

    That file 8054.xls is loading fine
    This 8054.xls having 10 rows ..but i got in the messagebox only 0
    as per your suggestion i sellected "Run one iteration only"

    -------------------------------------
    I am using Trail version

    Help me Please.......
    Thanks & Regards

    Marshal

  8. #8
    Senior Member
    Join Date
    Dec 2003
    Location
    Chennai
    Posts
    166
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to handle external data table ?

    Now i got Row Count..........but i can't get the data from that table
    Thanks & Regards

    Marshal

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:34 AM.

Copyright BetaSoft Inc.