Highlighted
Respected Contributor.. Respected Contributor..
Respected Contributor..
562 views

Sorting a Datatable?

Jump to solution

There are times when we need to sort a datatable to only show specific data.  Is there any other way to do this in UFT then Exporting the datatable, sorting, resave the file, import and replace the datatable with newly sorted one?  Would like to do this in UFT rather than having to use the Export/Import process.

 

What are the other approaches/best practices when it comes to sorting in UFT?  Please advise and thanks. -R-

Labels (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Re: Sorting a Datatable?

Jump to solution

Hi R

I hope you have a nice day!

 

Regarding this details remember UFT is a tool that works with Objects so basically this options are not able to be performed due the properties of the datatable objects are unable to set any kind of filter to the information stored in the Object Repository. So far the procedure that allows you to get the specific information filtered as required will be the one you commented, first export the data, apply the changes or filters manually and finally import the information.

This may be an useful detail that UFT may improve in future releases but so far this task is not able to be performed in in the versions released so far (until 12.02 Patch 2)

Also you can confirm details related to this subject regarding the DataTable in the UFT Help Guide:

"Note: All methods performed on this object apply to the run-time data table object only. Changes to the tun-time DataTable object are reflected in the results, but the design-time data table is not affected."

I hope this information was useful for you.

I'll be waiting for your response
Best Regards,

 

Andrés J. Brenes

HP Software Support.

[If this information solves or helps solve your issue, mark the answer as helpful]

 

[Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer. No warranties express or implied for any solution/suggestion posted.]

 

Andrés J. Brenes
HP Software Support.
[If this information solves or helps solve your issue, mark the correct one with "Accept as solution" or as "helpful"]
 
[Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.
No warranties express or implied for any solution/suggestion posted.]

View solution in original post

4 Replies
Highlighted
Absent Member.
Absent Member.

Re: Sorting a Datatable?

Jump to solution

Hi R

I hope you have a nice day!

 

Regarding this details remember UFT is a tool that works with Objects so basically this options are not able to be performed due the properties of the datatable objects are unable to set any kind of filter to the information stored in the Object Repository. So far the procedure that allows you to get the specific information filtered as required will be the one you commented, first export the data, apply the changes or filters manually and finally import the information.

This may be an useful detail that UFT may improve in future releases but so far this task is not able to be performed in in the versions released so far (until 12.02 Patch 2)

Also you can confirm details related to this subject regarding the DataTable in the UFT Help Guide:

"Note: All methods performed on this object apply to the run-time data table object only. Changes to the tun-time DataTable object are reflected in the results, but the design-time data table is not affected."

I hope this information was useful for you.

I'll be waiting for your response
Best Regards,

 

Andrés J. Brenes

HP Software Support.

[If this information solves or helps solve your issue, mark the answer as helpful]

 

[Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer. No warranties express or implied for any solution/suggestion posted.]

 

Andrés J. Brenes
HP Software Support.
[If this information solves or helps solve your issue, mark the correct one with "Accept as solution" or as "helpful"]
 
[Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.
No warranties express or implied for any solution/suggestion posted.]

View solution in original post

Highlighted
Respected Contributor.. Respected Contributor..
Respected Contributor..

Re: Sorting a Datatable?

Jump to solution

So it sounds like I am already using the best practice, how about if I rephrase the question, because I use the same method to append datatables into one.  Looping through a parameter that gathers data.  Is there a best practice to append and clear a datatable?  I find myself exporting and leaving UFT to Excel, performing task that UFT cannot do and reimporting it back in after data is saved off to a file, chg'd, resaved again for import/use back into UFT.  (We do a lot of SAP and UFT work).

 

Either of these as an add to future UFT releases would but great, and removing the need to have to export/import.   Keeping it all internal to UFT nice.  It does work with coding but would greatly reduce all that additional code.

 

Very interested in, whether there is a clear datatable option???  That is another thing I do while the export is saved out.

Please advise and thanks.  -R-

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Sorting a Datatable?

Jump to solution

Rhozeski,

 

Remember UFT is able to work with the properties/methods of the datatable objects only so you can review the available options to be sure if any of the listed ones may be helpful:

 

- Add Sheet

- Delete Sheet

- Export

- Export Sheet

- GetCurrentRow

- GetRowCount

- GetSheet

- GetSheetCount

- Import

- Import Sheet

- SetCurrentRow

- SetNextRow

- SetPrevRow

- GlobalSheet Property

- LocalSheet Property

- RawValuew Property

- Value Property

 

 

As I commented you before, the complete details are explained and may be confirmed in:

 Help-UFT Help:

 

 

 

 

 

Best Regards,

 

Andrés J. Brenes

HP Software Support.

[If this information solves or helps solve your issue, mark the answer as helpful]

 

[Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer. No warranties express or implied for any solution/suggestion posted.]

 

Andrés J. Brenes
HP Software Support.
[If this information solves or helps solve your issue, mark the correct one with "Accept as solution" or as "helpful"]
 
[Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.
No warranties express or implied for any solution/suggestion posted.]
0 Likes
Highlighted
Respected Contributor.. Respected Contributor..
Respected Contributor..

Re: Sorting a Datatable?

Jump to solution

Yes, and thanks. -R-

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.