Jump to content
Sign in to follow this  
SorryButImaNewbie

How do i communicate with a QueryGrid?

Recommended Posts

Hi!

I try to communicate with a QueryGrid, I'm not sure but I think the query is custom built. I can navigate with Send and other functions, but I would like to find a string or something (with I want to use to specify a Line and select it after)

I don't use Send because there isn't the same number of elements in the query so it can't be used here.

Also I'dont know what else should I post to help you helping me :) (which I'm very thankfull for) please ask anything and If I can i post it

My codes I tried (not all, I modified these couple of times, trying to get it run) 

Thank you!

Local $LineCount = ControlCommand('Folyószámla', "", "[CLASSNN:TAdvQueryGrid1]", "GetLineCount", "")
    MsgBox(0, "Zero", $LineCount) ;$LineCount = 0, while there are 2 lines)


    ;If ControlCommand('Folyószámla','','[CLASSNN:TAdvQueryGrid1]','FindString','AZBY') <> 0 Then
    ;ControlCommand('Folyószámla','','[CLASSNN:TAdvQueryGrid1]','GetSelected','AZBY') ;not working
    ;EndIf
Edited by SorryButImaNewbie

Share this post


Link to post
Share on other sites

To check if the ControlCommand has run successfully you should check the value of @error.

According to the help file "In case of an error (such as an invalid command or window/control), @error=1"


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

The last executed function sets @error and @extended.

So it is fine as long as the MsgBox statement immediately follows the ControlCommand


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I dont think its a problem if there is a variable like this

Local $LineCount = ControlCommand('Folyószámla', "", "[CLASSNN:TAdvQueryGrid1]", "GetLineCount", "")
    MsgBox(0, "Zero", @error)

So this means, there is no error message from ControlCommand? Yet it does exactly noting

Is there anydifferenc between "GetLineCount" and 'GetLineCount' ? or between " " and ' ' in general?

Edited by SorryButImaNewbie

Share this post


Link to post
Share on other sites

No. ' and " are valid string delimiters.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Now I'm trying to do the same thing with another control (taking an alternate approach) It's a ListView , tried with WinMenuSelectItem ,ControlListView ,ControlCommand. None of them worked.

(same code with different windowhandle and classNN) Is there any other Command I should try?

Share this post


Link to post
Share on other sites

I didn't find anything on the web so I'm not sure you can automate this controls.

AutoIt is focused on Windows controls.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

So if the guys who made this program, played around a bit in the listview/querygrid I wont be able to automate it? Unless I somehow make it, that my script find the "picture" of what I'm looking for then do clicks with coordinates?  (at least the window always popup the same place so theoraticly it can be done,I read somewhere in the forum that autoit can find pictures in the monitor so its possible right?)

Share this post


Link to post
Share on other sites

AutoIt seems to find the Control, hence @error = 0.

But if the control does not handle the "GetLineCount" command then you are out of luck :(


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

500px-GoodNewsEveryone.jpg

Good news everyone!

After some other matters I had to take care of, I tried to prove your assumption, I selected an item in the "Ügyfél" window and run the following code

Test()

Func Test()
    WinActivate("Ügyfél")
        ;WinMenuSelectItem("Ügyfél","","AZBY","AZBY")
        ControlListView("Ügyfél","","[CLASSNN:TListView1]","SelectClear","")
    ;Local $LineCount = ControlCommand('Ügyfél', "", "[CLASSNN:TListView1]", "GetLineCount", "")
    ;MsgBox(0, "Zero", $LineCount)
    ;ControlGetFocus
EndFunc

It deselected the item, it means the Listview should be able to handle the AutoIt commands right?

(Edited for some grammatic error, as usual)

Edited by SorryButImaNewbie

Share this post


Link to post
Share on other sites

Does the GetItemCount command work and return a valid result?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi! (sorry when i read your response, i wasn't in the office anymore, so couldn't test it)

Local $ItemCount = ControlListView("Ügyfél","","[CLASSNN:TListView1]","GetItemCount","")

MsgBox (0, "ItemCount", $ItemCount)

Returns 2 (in a list with 2 items) so I think the list is reachable by ControlListView. (ControlCommand with getlinecount returns 0 in the same list, so I'm going to ditch that for this function)

I had a few idea what to do if I reach and can get the itemcount of the list, but i need my coffee to remember any of that.

Good morning everyone :)

Share this post


Link to post
Share on other sites

Sounds good :)

If you have further questions we will be happy to assist.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

How can I invoke a Subitem (column) with listview? I tried to give it numbers, and the name of the column with string.

The help file says "FindItem", "string to find" [, SubItem] do I really need to place the [] open before the coma? It gave a syntax error, tried with simple "" and other variatons of [] and combinations with "".

Forum search give threads about GUI building, near nothing about working on other forms.

(I try to find my new list item, by its ID, first row and its a number, but not sure about its data type)

(edit)

Most of my tries resulted in either error or MsgBox not popint up

Full code is:

Test()

Func Test()
    WinActivate("Folyószámla")

    $index = ControlListView("Folyószámla", "","[CLASSNN:TAdvQueryGrid1]","FindItem", "255836926"[0])
    MsgBox(0, "ItemCount", $index)
    
EndFunc

(/edit)

PS.: (data type = string double etc. )Sorry I realize that many time i use incorrect offical terminology, i was always bad at that, hope that I'm still understandable most of the time :)

Edited by SorryButImaNewbie

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...