Micro Focus QTP (UFT) Forums
DataTable.GlobalSheet.DeleteRows - 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: DataTable.GlobalSheet.DeleteRows (/Thread-DataTable-GlobalSheet-DeleteRows)



DataTable.GlobalSheet.DeleteRows - Guillaume@cegc - 10-28-2009

Hi,

when I use the "Expert View" in qtp and I use auto completion, qtp IDE show me a DeleteRows method on the DTSheet object :

Code:
DataTable.GlobalSheet.DeleteRows
But at runtime it always say that this object doesn't know this property or this method.
So, why does qtp propose that ???

Does someone know how to delete rows in a runtime datasheet ?
Same thing with DataTable.GlobalSheet.Clear...


RE: DataTable.GlobalSheet.DeleteRows - sreekanth chilam - 10-28-2009

Hi,

Not sure about DataTable.GlobalSheet.DeleteRows. let us know where did u find about the above.

But deletion of columns(fields) is possible.
Syntax : DTSheet.DeleteParameter(ParameterID/Name)
Code:
Example : DataTable.GetSheet("dtGlobalSheet").DeleteParameter("Place")



RE: DataTable.GlobalSheet.DeleteRows - venkatbatchu - 10-29-2009

Hi,
I am not sure about deleting rows and columns in datatable. but u can delete the rows and cloumns in external file i.e,
1.Let say u want to import a file c:/file1 (it consists of 10 rows and 5 columns)
2.But u dont need all these data so u might be deleting some rows and some coumns which is the datat u dont require (Ex: c.rows(rownumber).delete, c.columns(coulmn number).delete), here c is an object whichu have to create)
3.Do not save this file , just save as file with file2 (After deleting the rows and cloumns then this might be the required one)
4.Now u can import the file2 in global sheet
5.Perfom the operation as u like.....

Please let me know if u need any code related stuff , try for some time to get the soultion and then let me know about this....

'sreekanth chilam' suggested code is for deleting columns i.e parameters only....


RE: DataTable.GlobalSheet.DeleteRows - Guillaume@cegc - 10-29-2009

>> let us know where did u find about the above.

please look at the capture screen I attached :
[attachment=320]
>> please look at the capture screen I attached :

ok, it seems that the attachment didn't work.
Please just go in the expert view and type :
datatable.globalsheet.

After the last dot the autocompletion box appears with the DeleteRows method in it.


RE: DataTable.GlobalSheet.DeleteRows - Saket - 10-30-2009

Hi Guillaume@cegc
which QTP version you are using? I don't see any method as 'DeleteRows' for global sheet in QTP 10.(refer attachment)


RE: DataTable.GlobalSheet.DeleteRows - sreekanth chilam - 10-30-2009

Hi Saket,

I am using QTP 9.5, even I too found this "Datatable.GlobalSheet.DeleteRows" method in IDE.

Refer the attached file for more info.


RE: DataTable.GlobalSheet.DeleteRows - Saket - 10-30-2009

strange, I cant see this in QTP 10. Not sure why it has been removed.


RE: DataTable.GlobalSheet.DeleteRows - Guillaume@cegc - 10-30-2009

I use QTP 9.2.

The best way I found to delete all rows of a sheet is that :

Code:
Public Function ResetSheet(sheetname)
   DataTable.ImportSheet Environment.Value("TestDir") & "\Default.xls", sheetname, sheetname
End Function