GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Testing Tools  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 677 of 684    Print  
Copy Datatable Content
How to copy a datatable content from globalsheet to localsheet (action1)?


  
Total Answers and Comments: 4 Last Update: August 31, 2009     Asked by: naglaxmi 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
October 23, 2008 16:08:57   #1  
madhavi Krishnarajpet Member Since: October 2008   Contribution: 6    

RE: Copy Datatable Content
Select the content in datatable from global sheet
1. Right click the datatable

2. Click edit
3. Click copy

In action sheet
4. Right click the edit and
5.
Click paste

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 3Overall Rating: -3    
June 16, 2009 06:12:57   #2  
Satish_kunchi Member Since: June 2009   Contribution: 1    

RE: Copy Datatable Content
You can use the ExportSheet property of the DataTable.

The syntax is as follows :


DataTable.ExportSheet "<Path of the Local excel sheet>" "<Global Sheet name>".

For ex:

I have added data to the Datatable in the sheet with the name 'Sheet_001' and then exported that into a local sheet.

DataTable.AddSheet ("Sheet_001").AddParameter "OrderNumber" ORN
DataTable.ExportSheet "D:OrderDetails.xls" "Sheet_001".

 
Is this answer useful? Yes | No
June 27, 2009 10:08:16   #3  
sujata_2221981 Member Since: May 2009   Contribution: 9    

RE: Copy Datatable Content
c datatable.Value("A" 1)
msgbox c
datatable.GetSheet(2)
datatable.SetCurrentRow(1)
DataTable.GetSheet (dtLocalSheet).AddParameter "A" c
d datatable.Value("A" 2)
msgbox d

' but it will be visible only for the run session.

 
Is this answer useful? Yes | No
August 31, 2009 06:36:18   #4  
qtpdeepak Member Since: June 2009   Contribution: 2    

RE: Copy Datatable Content

If the User wants to Copy all the Data from all the Rows to a Column in a Separate Sheet. Then the following code will be helpful.

A DataTable.GetRowCount

DataTable.GetSheet(dtLocalSheet).AddParameter "CopiedData" ""

For i 1 to A
DataTable.SetCurrentRow(i)
b DataTable.Value("Values")
DataTable.Value("CopiedData" dtLocalSheet) b
Next


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape