11-07-2009, 03:16 PM
Hi Ratna,
Yes, you can add datasheets to Runtime Datatable.
Syntax
DataTable.AddSheet(SheetName)
Example:
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:
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 :
"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
[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:
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.
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