Repeating Expression Box from Secondary DS in Main DS Repeating Table - InfoPath Dev
in

InfoPath Dev

Repeating Expression Box from Secondary DS in Main DS Repeating Table

Last post 06-05-2007 01:09 PM by Greg Collins. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 05-30-2007 08:50 AM

    Repeating Expression Box from Secondary DS in Main DS Repeating Table

    Hi!
    Help please!
    I'm developing InfoPath form for editing data in MS SQL Server 2005
    DB (directly connected).


    I have table (t1) with data and view (v1) which calculates special
    values for each row of table (t1).

    I want to display in repeating InfoPath table data from t1 and
    corresponding values for each row from v1 with ability to edit data in
    t1. t1 and v1 link through t1 Primary Key.

    When I select data from t1 and v1 in other SQL view and set it as Main
    data source in InfoPath I can't submit data in t1.

    When I set t1 as Main data source I can't attach data from v1
    (Secondary data source) to each row in repeating table. Field from v1
    displays value only from first row of v1, but not changes it for each
    row.

  • 05-30-2007 09:36 AM In reply to

    Re: Repeating Expression Box from Secondary DS in Main DS Repeating Table

    You will need to use filters on v1 field to make sure they key correctly to the current row.

    i.e. you would place your expression box in the table row, and then add a filter to the expression box such that the v1 key matches the key of the current row.

  • 05-30-2007 11:59 PM In reply to

    Re: Repeating Expression Box from Secondary DS in Main DS Repeating Table

    Greg, thank for advise.

    But I don't know how I can take current row ID in t1. 

    I used such expression:

    xdXDocument:GetDOM("v1")/dfs:myFields/dfs:dataFields/d:v1/@Value[../@ID = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/d:t1/@ID]

    But this expression box displays value from v1 that matches with first ID in t1 for all rows.

    What do I wrong? 

     




  • 06-04-2007 09:38 AM In reply to

    Re: Repeating Expression Box from Secondary DS in Main DS Repeating Table

    Do a little research on the XPath function: current()

    This will help you accomplish what you want to do. Your XPath above would be something like (not necessarily exactly like):

    xdXDocument:GetDOM("v1")/dfs:myFields/dfs:dataFields/d:v1/@Value[../@ID = current()/@ID]

    Hope this helps.

  • 06-05-2007 05:23 AM In reply to

    Re: Repeating Expression Box from Secondary DS in Main DS Repeating Table

    Thanks, Greg!!!

    It was very useful. 

  • 06-05-2007 01:09 PM In reply to

    Re: Repeating Expression Box from Secondary DS in Main DS Repeating Table

    Great! Glad to have been of some assistance.
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.