Select top three rows from secondary database in repeating table. - InfoPath Dev
in

InfoPath Dev

Select top three rows from secondary database in repeating table.

Last post 07-17-2010 06:05 AM by Skarn. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 07-06-2010 12:17 AM

    Select top three rows from secondary database in repeating table.

    Hi, Im running into an issue where I have to select top three rows from database and display them on my browser enabled infopath for. Issue is: User will select a name from drop down box (only unique values selected), on infopath form I want to show only top three rows from share point list for that name. There can be multiple values like 10 for a user, I want to display only 3 in info path form. Any clue how to do that. I have tried using rules, conditional formatting... Can you please guide. Thanks in advance.
  • 07-06-2010 02:23 AM In reply to

    Re: Select top three rows from secondary database in repeating table.

     try using this conditional formatting on the repeating table

     

    count(preceding-sibling::*) + 1 > 3

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 07-06-2010 02:31 AM In reply to

    Re: Select top three rows from secondary database in repeating table.

    Hi, I want to display maximum of three records, but it can be 1 or two also. I want to display ProcessingDates if there has been some processing done for someone during the past three months (from today). It should display max of 3 if its more than 3 during past three months or it can also display 1 or 2 dates if it is ...

  • 07-06-2010 04:38 AM In reply to

    Re: Select top three rows from secondary database in repeating table.

     sorry i forgot to mention that you will have to use conditional formatting to hide the field on the condition

    count(preceding-sibling::*) >= 3

    this will display a maximum of three records

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 07-06-2010 05:08 AM In reply to

    Re: Select top three rows from secondary database in repeating table.

    Sorry, it does not solve my problem. I want to display 3 rows and hide or delete the remaining rows that are retieved from database for that name selected from dropdown. But this solution hides all of them.

  • 07-06-2010 08:26 AM In reply to

    Re: Select top three rows from secondary database in repeating table.

     yes you are right, it wont work in this situation, i didnt notice that you were using rules to show hide some rows already. i will get back to you on this tomorrow

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 07-07-2010 05:25 AM In reply to

    Re: Select top three rows from secondary database in repeating table.

    Hello, any help on this?

  • 07-17-2010 06:05 AM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: Select top three rows from secondary database in repeating table.

    Could you make an additional secondary data source (retrieve values type) and ask it to retrieve the values from the table with the user names and the dates? This would be ok for an SQL database - not sure on Sharepoint.

    Then set a filter on the secondary datasource which is based on the currently selected value of the user name and requery it when suitable.

    The secondary data source will contain the dates for that username. You could try one of these approaches - further adjust the filter for something like 'AND position() <= 3 or use conditinal formatting on the repeating section/table display to hide when position() > 3.

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