Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add multiple local datatables to one action?
#4
Solved: 11 Years, 4 Months ago
Hi Ratna,

Yes, you can add datasheets to Runtime Datatable.

Syntax
DataTable.AddSheet(SheetName)

Example:
Code:
Datatable.AddSheet("xxxx")

Datatable.Importsheet Imports a sheet of a specified file to a specified sheet in the run-time Data Table. The data in the imported sheet replaces the data in the destination sheet
Syntax :
DataTable.ImportSheet(FileName, SheetSource, SheetDest)

Example:
Code:
Datatable.Importsheet "C:\doc & Settings\sample.xls","Sheet1","xxxx"


For Adding parameters you can use "AddParameter" method:
"AddParameter" method Adds the specified parameter (column) to the sheet in the run-time Data Table.
Syntax
DTSheet.AddParameter(ParameterName, Value)

Example :
Code:
DataTable.GetSheet("xxxx").AddParameter "Place","INDIA"

"also in my script do i have to give like this
Browser("").Page("").webedit("").Set DataTable("RFCN",dtLocalSheet) even for runtime datatable data if RFCN is a column in my runtime datatable?"
--> You can give as below
Code:
Browser("").Page("").webedit("").Set DataTable("colname","xxxx")

[color]"how do i get the rowcount just like the global/local datatable?
what would i give in place of Global and Action1??? if its a runtime datatable?"--> [/color]You can give as below:

Code:
NewsheetRowcount=datatable.GetSheet("xxxx").GetRowCount

Finally, for your [color]"how am i gonna do the above for 10 rows and 10 columns"[/color] question use the below code & execute, check the test results for RunTime Datatable.

Code:
Datatable.AddSheet"xxxx"
    For i=1 to 10
         Datatable.GetSheet("xxxx").AddParameter "Col"&i,""
    Next
  
    For j=1 to 10
      Datatable.GetSheet("xxxx").SetCurrentRow(j)
           For k=1 to datatable.GetSheet("xxxx").GetParameterCount
                 Datatable.Value("Col"&k,"xxxx")="Value of"&"Row"&j&"Col"&k
           Next
    Next
  
   msgbox Datatable.GetSheet("xxxx").Name&" : "&Datatable.GetSheet("xxxx").GetRowcount
Reply


Messages In This Thread
RE: How to add multiple local datatables to one action? - by sreekanth chilam - 11-07-2009, 03:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Local System Monitor kbhargava505 0 2,522 10-16-2015, 12:52 PM
Last Post: kbhargava505
  Case changes while reading values from inbuilt datatables krishnakittu03 3 2,964 04-28-2015, 11:34 AM
Last Post: kbhargava505
  How to Create and use local repository Sourabh146 2 2,542 01-28-2014, 10:56 PM
Last Post: jacosta
  how to access Local dataTables in another action within a same script RA185112 5 6,037 07-25-2012, 01:27 PM
Last Post: sshukla12
  Update from Local repository DeeptiNR 4 5,051 04-10-2012, 07:29 AM
Last Post: DeeptiNR

Forum Jump:


Users browsing this thread: 1 Guest(s)