Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write in Excel
#20
Solved: 11 Years, 3 Months, 2 Weeks ago
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)
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
Reply


Messages In This Thread
Write in Excel - by Anu - 05-24-2010, 09:45 AM
RE: Write in Excel - by Saket - 05-24-2010, 11:12 AM
RE: Write in Excel - by Anu - 05-25-2010, 09:43 AM
RE: Write in Excel - by basanth27 - 05-24-2010, 02:31 PM
RE: Write in Excel - by Saket - 05-25-2010, 11:08 AM
RE: Write in Excel - by Anu - 05-25-2010, 11:26 AM
RE: Write in Excel - by Saket - 05-25-2010, 12:43 PM
RE: Write in Excel - by Anu - 05-25-2010, 12:54 PM
RE: Write in Excel - by Anu - 05-25-2010, 03:19 PM
RE: Write in Excel - by Saket - 05-25-2010, 03:21 PM
RE: Write in Excel - by Anu - 05-26-2010, 10:20 AM
RE: Write in Excel - by Saket - 05-26-2010, 12:56 PM
RE: Write in Excel - by Anu - 05-26-2010, 03:21 PM
RE: Write in Excel - by Saket - 05-26-2010, 03:22 PM
RE: Write in Excel - by Anu - 05-26-2010, 03:49 PM
RE: Write in Excel - by Saket - 05-26-2010, 03:53 PM
RE: Write in Excel - by Anu - 05-26-2010, 04:54 PM
RE: Write in Excel - by Saket - 05-26-2010, 06:25 PM
RE: Write in Excel - by Anu - 08-23-2010, 10:38 AM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 11:21 AM
RE: Write in Excel - by Anu - 08-23-2010, 12:17 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 12:25 PM
RE: Write in Excel - by Anu - 08-23-2010, 12:42 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 12:48 PM
RE: Write in Excel - by Anu - 08-23-2010, 12:58 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 01:48 PM
RE: Write in Excel - by Anu - 08-23-2010, 02:17 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 02:51 PM
RE: Write in Excel - by Anu - 08-23-2010, 03:03 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 03:07 PM
RE: Write in Excel - by Anu - 08-23-2010, 03:29 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 03:54 PM
RE: Write in Excel - by Anu - 08-23-2010, 04:00 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 04:26 PM
RE: Write in Excel - by Anu - 08-23-2010, 04:47 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 04:59 PM
RE: Write in Excel - by Anu - 08-23-2010, 05:05 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 06:57 PM
RE: Write in Excel - by Anu - 08-24-2010, 09:42 AM
RE: Write in Excel - by venkatbatchu - 08-24-2010, 09:53 AM
RE: Write in Excel - by Anu - 08-24-2010, 11:45 AM
RE: Write in Excel - by venkatbatchu - 08-24-2010, 12:15 PM
RE: Write in Excel - by Anu - 08-24-2010, 01:00 PM
RE: Write in Excel - by venkatbatchu - 08-24-2010, 01:47 PM
RE: Write in Excel - by Anu - 08-24-2010, 03:03 PM
RE: Write in Excel - by Anu - 08-25-2010, 09:18 AM
RE: Write in Excel - by venkatbatchu - 08-25-2010, 05:50 PM
RE: Write in Excel - by Anu - 08-24-2010, 10:01 AM
RE: Write in Excel - by Saket - 08-25-2010, 06:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Write in Excel Continued Anu 3 3,302 08-27-2010, 08:53 AM
Last Post: basanth27
  Write Heading in excel Anu 27 19,785 08-05-2010, 03:02 PM
Last Post: Anu

Forum Jump:


Users browsing this thread: 3 Guest(s)