Micro Focus QTP (UFT) Forums
Data tables - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Data tables (/Thread-Data-tables--3804)



Data tables - kumarts - 09-24-2010

Hi, Can some one give me an idea to resolve below issue.

I am trying to create a test that will create multiple orders with different Materials. I am able to create multiple orders but with only one material. I am using a data table within QTP and pulling the data to create the orders, but when I add another Material to the table it make it another line item in the order. I have tried SetCellData and GetCellData in QTP with no success.


RE: Data tables - KavitaPriyaCR - 11-25-2010

Hi You mean the result should be as:
----------------------
Orders Materials
----------------------
Order1 Material1
<BlankSpace> Material2

Order2 Material3
<BlankSpace> Material4
<BlankSpace> Material5
----------------------

If this is the case, then you should specify the cell as
'when pushing data to Datatable:
Code:
k=1
DataTable.GetSheet("SheetName").SetCurrentrow=k
DataTable("Orders","SheetName")=Order1
DataTable("Materials","SheetName")=Material1
k=k+1
'When pulling data from dataTable:
DataTable.GetSheet("SheetName").SetCurrentrow=k         ' specify required row here
getOrder=DataTable("Orders","SheetName")