Commander Commander
Commander
216 views

Datasheet(Global) row count

I am trying to get a count of rows ( based on Usernames entered).

I have used  'Rowcount= DataTable.GetSheet("Global").GetRowCount
'msgbox "RowCount= " &RowCount,1

but each Iteration brings back the row total at the end of that Iteration. 

What I would like to see, is the row count in increments after each Iteration , with a total at the end of all rows and then show that Total as "Total Login Usernames = "

 

 

 

 

0 Likes
5 Replies
Knowledge Partner Knowledge Partner
Knowledge Partner

Try:

currRow = DataTable.GetSheet("Global").GetCurrentRow
msgbox "Current Row = " & currRow

Mark Smith

Commander Commander
Commander

Mark,

That code worked on handling showing the rows in increments. Thank you. 

Any idea on the second part of showing the final total of rows in the output? maybe showing the count in a column and then the total?

0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

Assuming you are processing all rows add this as the last line of you code . What this is checking is, if this is the last row in the table write out the total number of rows

If Cint(DataTable.GetSheet("Global").GetCurrentRow) = Cint(DataTable.GetSheet("Global").RowCount) Then
    MsgBox "Rows Processed =" Cint(DataTable.GetSheet("Global").RowCount)
End If

Mark Smith.

 

0 Likes
Commander Commander
Commander

I used coude sent, but received this Run error -

Object doesn't support this property or method: 'DataTable.GetSheet(...).Rowcount'

Line (63): "If Cint(DataTable.GetSheet("Global").GetCurrentRow) = Cint(DataTable.GetSheet("Global").RowCount) Then".

0 Likes
Micro Focus Expert
Micro Focus Expert

looks the syntax is incorrect. the method getCurrentRow needs a pair of parathesis. 

and the dtSheet object doesn't have RowCount property. 

https://admhelp.microfocus.com/uft/en/all/AutomationObjectModel/Content/QTReservedObjects/Output/Parameterization_DTSheet.htm

thanks.

James

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.