Alpha Video Training
Results 1 to 10 of 10

Thread: Grid advanced search. How can I work with only those results?

  1. #1
    Member
    Real Name
    Gary Coslop
    Join Date
    Sep 2019
    Posts
    27

    Default Grid advanced search. How can I work with only those results?

    Hello,

    This is my first post. I tried searching for the answer first, and maybe it was answered and I searched wrong, but I could not find what I was looking for.

    I have grid 1 with table 1. I configured Advanced Search, and I can search what I need to search. Say I have 100 rows of data, and with the search I do, it comes down to 5 rows. I need to work with only those 5 rows from the entire table. I don't care if I insert those rows into table 2 on grid 2, or if there is a way to stay on grid 1 with table 1 and work with them.

    I feel like I have searched so long that I am trying to make the solution more complicated than what it really is. This is a relatively common need, so I'm sure there is a simple way to work with this in Alpha, but I cannot find it. Suggestions?

  2. #2
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,358

    Default Re: Grid advanced search. How can I work with only those results?

    Gary, you are in the desktop section.
    Did you mean to be?
    Grids work in both, so please advise.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  3. #3
    Member
    Real Name
    Gary Coslop
    Join Date
    Sep 2019
    Posts
    27

    Default Re: Grid advanced search. How can I work with only those results?

    Yes. I meant to be in desktop. This project is not going to be a mobile app in the foreseeable future.

  4. #4
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,358

    Default Re: Grid advanced search. How can I work with only those results?

    What do you want the result to look like?
    Can you create a mock up?
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  5. #5
    Member
    Real Name
    Gary Coslop
    Join Date
    Sep 2019
    Posts
    27

    Default Re: Grid advanced search. How can I work with only those results?

    Untitled.png

    I can map the changing column names no problem. My problem is creating a new table with only the filtered results. I have messed around with the following code that I found in another search, however I am stuck, and perhaps it is with the line where it uses the search results.

    Code:
    dim mycn as sql::connection
    dim myargs as sql::arguments
    dim itworked as l
    dim mySQLcode as c
    
    mySQLcode = <<%txt%
    select ID, `Last Name`, `First Name`, etc
    insert into table2 (ID, LastName, FirstName, etc)
    from table1
    where <gridFilter>
    %txt%
    
    mycn.open("::Name::mydatabase")
    itworked = mycn.execute("truncate table table2")
    
    mySQLcode = strtran(mySQLcode,"<gridFilter>",e._gridCurrentFilter)
    myargs = e._gridCurrentArgumentsXML
    itworked = mycn.execute(mySQLcode,myargs)
    
    mycn.close()

  6. #6
    Member
    Real Name
    Gary Coslop
    Join Date
    Sep 2019
    Posts
    27

    Default Re: Grid advanced search. How can I work with only those results?

    I am a little lost in the code I just posted. if I am to label <gridFilter>, what do I label it with? I also get a bit lost in the myargs = section, so I need a little hand holding on this I believe. Like I said, I can get it to import unfiltered results no problem (with other code), but I need to import only filtered ones.

  7. #7
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,358

    Default Re: Grid advanced search. How can I work with only those results?

    If you are using SQL with Desktop, you would be better posting this on thw Web section.
    I don't use Alpha with SQL, I use a different product with SQLSERVER16.
    However, if you want to use native desktop the job is relatively easy.
    On one form, left hand side, a Browse.
    On the right, the fields you want to manage.
    Search in the Browse, select your row and edit the data on the right.
    You can create a Set and use a Click through on the Browse to open a specific Form, and you can create Table2 from Table one quite easily.

    Once it's all working, use the Upsize Genie to create your SQL Db and see what happens.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  8. #8
    Member
    Real Name
    Gary Coslop
    Join Date
    Sep 2019
    Posts
    27

    Default Re: Grid advanced search. How can I work with only those results?

    Ted,

    I thank you for your help. I was mistaken earlier. I was thinking the choices were "Desktop" or "mobile." I am using this for "Web." I will post to there. And thank you for your directions here. I do appreciate it.

  9. #9
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,358

    Default Re: Grid advanced search. How can I work with only those results?

    Glad you found the way home!
    The confusion is possibly that you can uuse Grids on a DT and they work well.
    Alpha DT using SQL has some limitations, but you will be fine if you use the Alpha WAS in a commercial publication and the locas WAS for development.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  10. #10
    "Certified" Alphaholic
    Real Name
    Gregg Schmidt
    Join Date
    Mar 2001
    Location
    Milwaukee
    Posts
    1,388

    Default Re: Grid advanced search. How can I work with only those results?

    Hi Gary,

    I'm going to point you to the OnSqlSelectQuery event.
    I believe I have one project using the advance search option, and part of what I absolutely
    wanted was to use the filter created by alpha.
    I'd give more details but I created this months ago, and while it does work, I have
    been directing my attention to other projects, mostly involving sql.

Similar Threads

  1. Update grid search part results
    By pcaspa in forum Application Server Version 11 - Web/Browser Applications
    Replies: 2
    Last Post: 11-04-2012, 12:42 AM
  2. Lookup values in search grid results
    By den1s in forum Application Server Version 9 - Web/Browser Applications
    Replies: 1
    Last Post: 10-07-2009, 12:31 PM
  3. Update Grid Search Results
    By scotthanes in forum Application Server Version 9 - Web/Browser Applications
    Replies: 0
    Last Post: 07-21-2009, 11:29 AM
  4. Update GRID search results.
    By scotthanes in forum Application Server Version 9 - Web/Browser Applications
    Replies: 3
    Last Post: 05-16-2009, 12:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •