08-23-2010, 11:21 AM
(This post was last modified: 08-23-2010, 02:55 PM by venkatbatchu.)
Hi,
Instead of using Excel obects you could go with data tables.
Lets assume that 1000 records are available on web page.
'if all the rows are displaying in sngle page (all the records) (Ex: 1000 records in single page)
If 1000 records are displaying in 50 pages i.e 20 records in one page (20 *50)
With the above code we could export the data which is available in Web table simply we can say data export from web table to data table and finally exporting to required path.
Please let me know for further clarification.
Thanks and Reagrds,
Venkat.Batchu
Instead of using Excel obects you could go with data tables.
Lets assume that 1000 records are available on web page.
'if all the rows are displaying in sngle page (all the records) (Ex: 1000 records in single page)
Code:
'To add the column names "Name","Address" for the data table.
Datatable.AddParameter("Name","")
Datatable.AddParameter("Address","")
'To fetch the row count from the web table
intrcount=Browser("xxxxx").Page("xxx").WebTable("xxxxx").GetRoProperty("eows")
For temp=1 to intrcount-1 step 1
Datatable.setcurrentrow(temp)
strcustname=Browser("xxxxx").Page("xxx").WebTable("xxxxx").GetCellData(temp,"Name")
straddress=Browser("xxxxx").Page("xxx").WebTable("xxxxx").GetCellData(temp,"Address")
strcustname=Datatable.Value("Name")
straddress=Datatable.Value("Address")
Next
Wait 3
Datatable.Export "File path"
If 1000 records are displaying in 50 pages i.e 20 records in one page (20 *50)
Code:
'To add the column names "Name","Address" for the data table.
Datatable.AddParameter("Name","")
Datatable.AddParameter("Address","")
'To fetch the row count from the web table
intrcount=Browser("xxxxx").Page("xxx").WebTable("xxxxx").GetRoProperty("eows")
For temp=1 to intrcount-1 step 1
Datatable.setcurrentrow(temp)
strcustname=Browser("xxxxx").Page("xxx").WebTable("xxxxx").GetCellData(temp,"Name")
straddress=Browser("xxxxx").Page("xxx").WebTable("xxxxx").GetCellData(temp,"Address")
strcustname=Datatable.Value("Name")
straddress=Datatable.Value("Address")
'To click the Next page
If ((temp%20)=0) Then
Browser("xxxxxxxx").Page("xxxxxxxx").Weblink("Next").Click
Browser("xxxxxxxxxxx").Page("xxxxxxxxxxxx").Sync
Wait 2
End If
Next
Wait 3
Datatable.Export "File path"
With the above code we could export the data which is available in Web table simply we can say data export from web table to data table and finally exporting to required path.
Please let me know for further clarification.
Thanks and Reagrds,
Venkat.Batchu