Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get data from an xml to excel which have more than 65000 rows
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi,
I have a large xml file which will result more than 65000 rows most likely 300000. And I have noticed data table in QTP have a limit of 65000 rows. Can some one tell me how to overcome this constraint and write all the xml results to an excel file.
Following is the logic i'm trying:
Code:
Const XMLDataFile = "C:\Users\damulur\Desktop\on_mov_programs-db_20101011_1.xml"
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
xmlDoc.Load(XMLDataFile)

datatable.AddSheet("output").AddParameter "TMSID",""

prg ="on/programs/program"
Set prg1=xmlDoc.selectNodes(prg )
For i=0 to (prg1.length-1)
TMS=prg1.item(i).getAttribute("TMSId")
DataTable.Value("TMSID","output") =TMS
DataTable.SetCurrentRow(i+1)
Next
DataTable.ExportSheet "C:\Users\damulur\Desktop\1.xls","output"
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Basically this is a limit in excel and so in QTP.
what you can do is once you get the row > 65000 then add a new sheet and start writing into it.
By the way , I can see that you are finally exporting it to a excel file, why dont you directly wirte into a excel sheet rather in datatable.

Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Saket,
Thanks for quick reply. I'm new to QTP. Can you pls tell me how to write data directly to excel file like adding parameter and then data values.
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
try searching this forum, I am sure this has been discussed earlier. Let me know for any confusion.

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple rows of test data Bhuvana 0 1,337 01-03-2020, 09:30 PM
Last Post: Bhuvana
  Want to read the data from excel and set read value in the JavaTable rajeevk7 0 2,309 07-10-2017, 04:20 PM
Last Post: rajeevk7
  dtLocalSheet empty even though excel file contains data cantorre 2 2,428 05-10-2017, 12:47 PM
Last Post: vidhi
  Reading data from excel sheet serenediva 1 9,598 03-03-2017, 10:07 AM
Last Post: vinod123
  Adding data into rows that add dynamically with setcelldata azar81 4 5,916 04-13-2015, 05:24 PM
Last Post: vidya2k2

Forum Jump:


Users browsing this thread: 2 Guest(s)