Micro Focus QTP (UFT) Forums
How to select imported rows from localdatatabel(runtime sheet) - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to select imported rows from localdatatabel(runtime sheet) (/Thread-How-to-select-imported-rows-from-localdatatabel-runtime-sheet)



How to select imported rows from localdatatabel(runtime sheet) - Uma - 10-21-2011

Hi,

This is my code.

Code:
For x = 1 to DataTable.GetRowCount
print x
'I am adding a sheet in my local datatable.
DataTable.AddSheet("DinInfo")
'Importing values from excel sheet,
DataTable.ImportSheet "C:\LCMan.xls","MyLi-DFa","DinInfo"
'I parmeterized the column:
DResut=(DataTable("In_Din","DinInfo"))
print Dresult
Next

If i print Dresult, it always give first row value why?,
It is not giving the second row value.

My resuls
x=1
Dresult=Din1


X=2
Dresult=Din1[Here I need second row value Din2]

Any help?
Thanks
Uma


RE: How to select imported rows from localdatatabel(runtime sheet) - Ankesh - 10-24-2011

Hi Uma,

Ur code is fine, bt it needs slight modification.

U need to incremet the row to point to the next row. So u will have to use a row counter. Ur code shloud be something like this...

Code:
intRowNo=1  'Initialize a row counter
For x = 1 to DataTable.GetRowCount
print x
'I am adding a sheet in my local datatable.
DataTable.AddSheet("DinInfo")
'Importing values from excel sheet,
DataTable.ImportSheet "C:\LCMan.xls","MyLi-DFa","DinInfo"
Datatable.GetSheet("DinInfo").SetCurrentRow intRowNo  'Point the focus to the current row using the counter
'I parmeterized the column:
DResut=(DataTable("In_Din","DinInfo"))
intRowNo=intRowNo+1  'increment the counter
print Dresult
Next

I hope this would solve ur problem..

Regards,
Ankesh


RE: How to select imported rows from localdatatabel(runtime sheet) - Uma - 10-25-2011

Hi Ankesh,
It is working with setcurrentrow
Thank you
Uma