How to present a table to user to make a selection - InfoPath Dev
in

InfoPath Dev

How to present a table to user to make a selection

Last post 01-14-2010 03:55 PM by Hilary Stoupa. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 01-04-2010 05:03 AM

    How to present a table to user to make a selection

    I have a secondary data connection which returns a DataSet of employee information.

    I want to display the records in a table and allow the user to choose 1 (or more) records from the table.

     Is there a way to do this?  What control(s) would I use?

     

    Thanks.

  • 01-07-2010 03:13 PM In reply to

    Re: How to present a table to user to make a selection

    Is this a SQL connection? Access? XML? What do you want to have happen after the record is selected?

    Sometimes in SQL, I add a dummy field to a view that I then bind a checkbox to: CAST(0 AS BIT) AS SelectedRow for my new field, for example. If your data source is an XML file, simply modify the XML file to include an element for selection.

    Hilary Stoupa

  • 01-07-2010 07:20 PM In reply to

    Re: How to present a table to user to make a selection

    Hilary,

    Thanks for the reply.

    I guess what I'm looking for is a multiselect table as opposed to a multiselect listbox. 

    It's a SQL connection.

     

    Dave

  • 01-08-2010 09:25 AM In reply to

    Re: How to present a table to user to make a selection

    And, so you know, I'm not trying to nitpick on the details, but I am curious as to what you intend to do with the rows once they have been 'selected'? That may have something to do with the best approach. You have been trying qRules, I know that from the other thread we've been chatting in -- are you going to copy your 'selected' rows into your main data source?

    I'd modify my SQL connection to include a dummy field for 'SelectedRow' as mentioned above. If you walk through the data connection wizard again, you'll see on the screen that shows your SQL tree a button that says something about SQL (I don't remember the exact wording) and if you click it you can see the SQL InfoPath is using to return the data. Add another field as I mentioned above, and you should be good to go.

    Then, for your source for your copy table command, you can select just the rows where SelectedRow = true.

    Hilary Stoupa

  • 01-08-2010 01:37 PM In reply to

    Re: How to present a table to user to make a selection

     

    Yes, except I'm copying them to the queryfields of a secondary data source.  So, it's not a sql connection, it's a web service connection. 

    So, I put up a list of items in a multi-select listbox, let the user choose some, then send the selected items in a repeating table to the web service.  I have to use qrules copytable to move them from my main datasource to the secondary one. 

     

    Dave

     

  • 01-08-2010 03:53 PM In reply to

    Re: How to present a table to user to make a selection

    I'm officially confused.

    I had thought you were saying:

    Data from SQL is brought into the form via a secondary data connection and displayed in my form
    I want users to select rows from this secondary data connection and do something with them

    It sounds like what you mean is:

    There is a repeating node in my main data source for my form
    I want users to select rows from this main data source and do something with them

    If the data you want users to be able to select is in your main data source, simply add another field with a data type of boolean in the same group as the rest of the data. Add the field to your repeating table as a checkbox. Your qRules command can then be filtered to use only the selected rows.

    Is the query field in your web service connection repeating?

    And, I'm sorry, but are you really wanting to select rows in a repeating table, or to use a multi select list box? I'm confused by that, too. :)

    Hilary Stoupa

  • 01-10-2010 03:06 PM In reply to

    Re: How to present a table to user to make a selection

    Hilary, The problem could be that I came up with a solution which is a bad solution and that's why I'm having so much difficulty.  So here’s what I’m really doing: I have a sql database of employees.  I have a web service that returns some of them as a dataset. I want to display these to the user, let the user select some of them, and return that new subset to another web service.  The web services are all secondary data connections. So, without getting into how I am attempting to do this, how should it be done? Dave

     

  • 01-12-2010 05:59 PM In reply to

    Re: How to present a table to user to make a selection

    Hi, Dave:

    What does the final web service do? Return a new data set based on the selected employees? What does it take for parameters? Do you have to query it for each employee name (if it is, indeed, returning data)?

    If you are returning a list from a web service, you could use it as a data source for a multi select list box (bound to a repeating main data source node)... but a lot depends on the parameters for your final web service.

    Hilary Stoupa

  • 01-13-2010 04:47 AM In reply to

    Re: How to present a table to user to make a selection

    Hi,

     Yes, the final web service returns a new dataset based on selected employees.  Currently that web service looks like this:

    public DataSet GetPersonTableFromPersonStringTable(personstring[] myRepTable).  

    The original data does come in as a dataset.  From that I pull out the personstrings above and use them in the multi-select box as you said above. What I'd prefer to do is present the user with several columns of the dataset as a "multi-select table" and let them choose from that.

     

    Dave

     

  • 01-14-2010 03:55 PM In reply to

    Re: How to present a table to user to make a selection

    So this kind of takes us back to my first thought -- modify your data source to contain an additional field you can use for your 'selected' checkbox. Did you create the web service?

    Hilary Stoupa

Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.