in

InfoPath Dev

displaying repeating data in sharepoint

Last post 08-10-2007 11:49 AM by lchungue. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 01-27-2006 12:03 PM

    displaying repeating data in sharepoint

    Hi

    I am trying to display data from a repeating data in sharepoint, but in infopath, I can only choose first, last or merge. I want to display the data in seperate rows.

    Is that possible??

    Does anyone know how to do it??

    Thank you.
  • 01-27-2006 02:11 PM In reply to

    Re: displaying repeating data in sharepoint

    I don't know that it can be done, but someone may wish to prove me wrong.

    Greg Collins [InfoPath MVP]
    InfoPath Dev
    Visit my Web site:

    http://www.braintrove.com

    Greg Collins / Microsoft MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-28-2006 01:03 AM In reply to

    Re: displaying repeating data in sharepoint

    Not possible, and this is the biggest limitation of SharePoint views. SharePoint supports flat promotion.

    However, one workaround is to create separate fields for each of the rows in your collection. Then you can display. Problem is that SharePoint limits the number of columns you can display.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 02-22-2006 02:06 PM In reply to

    Re: displaying repeating data in sharepoint

    Depending on how you need to represent your data, there is a way to represent your repeating sections in SharePoint -i did this for a customer that used IP to generate reports for oil-rig maintenance:

    Each repeating section is represented by a list (i used custom lists, document lists and image galleries, but you could really use what ever) in a WSS site:

    -general oil rig data
    -areas/rooms
    -maintenance comments
    -maintenance pictures
    -maintenance documents

    The area names wich are globally unique is then used to "bind" the data together with lookup columns (sort of like foreign keys in a relational database).

    All lists are transferred to SharePoint using SPS web services and managed code.

    You didnt provide much info on the data you need to represent, and what i have described probably isnt what you need, but it might give you an idea on how to represent IP data in SPS and for the customer in question it was a big success :-)

    hth

    //AndersR
  • 08-02-2007 05:10 PM In reply to

    Re: displaying repeating data in sharepoint

    Sorry to revive this long dead thread, but it seems to be one of the very few topics I could find which precisely talk about what I'm trying to achieve : a way to export datas contained in a repeating table to a(nother) SharePoint List.

    Patrick Halstead:
    Not possible, and this is the biggest limitation of SharePoint views. SharePoint supports flat promotion.

    However, one workaround is to create separate fields for each of the rows in your collection. Then you can display. Problem is that SharePoint limits the number of columns you can display.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev

    So my question is : does this still apply, 1 and half year later ? even with MOSS 2007 and InfoPath 2007 ?

     

    Thanks in advance,

     
    Ludovic
     

    Filed under: , ,
  • 08-06-2007 03:35 PM In reply to

    Re: displaying repeating data in sharepoint

    If all you're looking to do is push data from a repeating table to a separate sharepoint list then the following code should be able to help you out. It uses the already existing SharePoint updatelistitems web service to push the data. Hope this helps.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Dim iRowCount As Integer = thisXDocument.DOM.selectNodes("/my:myFields/my:MovementDetail").length()
                Dim i As Integer

                For i = 1 To iRowCount
                    Dim MovementDate As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:ProcessInfo/my:MovementDate").text

                    Dim MovementNumber As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:MovementDetail[" & i & "]/my:MovementTrackingNumber").text
                    Dim MovementLineNumber As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:MovementDetail[" & i & "]/my:MovementLineNumber").text
                    Dim MovementSource As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:MovementDetail[" & i & "]/my:Source").text
                    Dim MovementDestination As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:MovementDetail[" & i & "]/my:Destination").text
                    Dim TrackingNumber As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:MovementDetail[" & i & "]/my:TrackingNumber").text
                    Dim ActualMaterial As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:MovementDetail[" & i & "]/my:ActualMaterial").text
                    Dim ContainerType As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:MovementDetail[" & i & "]/my:ContainerType").text
                    Dim ContainerSize As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:MovementDetail[" & i & "]/my:Size").text
                    Dim Weight As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:MovementDetail[" & i & "]/my:MovementWeight").text
                    Dim MovementType As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:MovementDetail[" & i & "]/my:MovementType").text
                    Dim MovementForm As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:ProcessInfo/my:fName").text
                    Dim Type As String
                    If MovementType = "Split" Then
                        Type = "Split"
                    ElseIf MovementType = "Move" Then
                        Type = "Movement"
                    End If

                    Dim MovementTrackingID As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:MovementDetail[" & i & "]/my:MovementID").text

                    Dim Movement As New KINS.Lists
                    Dim cr As New System.Net.NetworkCredential("username", "password", "domain")
                    Movement.Credentials = cr

                    Dim doc As New XmlDocument
                    Dim updates As XmlElement = doc.CreateElement("Batch")

                    If MovementTrackingID = "" Then
                        updates.InnerXml = "<Method ID='1' Cmd = 'New'><Field Name = 'MovementNumber'>" + MovementNumber + _
                        "</Field><Field Name = 'MovementDate'>" + MovementDate + "</Field><Field Name = 'MovementLineNumber'>" + MovementLineNumber + _
                        "</Field><Field Name = 'MovementSource'>" + MovementSource + "</Field><Field Name = 'MovementDestination'>" + MovementDestination + _
                        "</Field><Field Name = 'TrackingNumber'>" + TrackingNumber + "</Field><Field Name = 'ActualMaterial'>" + ActualMaterial + _
                        "</Field><Field Name = 'ContainerType'>" + ContainerType + "</Field><Field Name = 'ContainerSize'>" + ContainerSize + _
                        "</Field><Field Name = 'Weight'>" + Weight + "</Field><Field Name = 'MovementType'>" + Type + "</Field><Field Name='MovementForm'>" + MovementForm + "</Field></Method>"

                        Movement.UpdateListItems("{SharePoint list id}", updates)
                    ElseIf MovementTrackingID <> "" Then
                        updates.InnerXml = "<Method ID='1' Cmd = 'Update'><Field Name = 'MovementNumber'>" + MovementNumber + _
                        "</Field><Field Name = 'MovementDate'>" + MovementDate + "</Field><Field Name = 'MovementLineNumber'>" + MovementLineNumber + _
                        "</Field><Field Name = 'MovementSource'>" + MovementSource + "</Field><Field Name = 'MovementDestination'>" + MovementDestination + _
                        "</Field><Field Name = 'TrackingNumber'>" + TrackingNumber + "</Field><Field Name = 'ActualMaterial'>" + ActualMaterial + _
                        "</Field><Field Name = 'ContainerType'>" + ContainerType + "</Field><Field Name = 'ContainerSize'>" + ContainerSize + _
                        "</Field><Field Name = 'Weight'>" + Weight + "</Field><Field Name = 'MovementType'>" + Type + _
                        "</Field><Field Name = 'ID'>" + MovementTrackingID + "</Field><Field Name='MovementForm'>" + MovementForm + "</Field></Method>"

                        Movement.UpdateListItems("{SharePoint list id}", updates)
                    End If

                Next

    Shaun Nieves
    Sharepoint Manager
  • 08-07-2007 11:43 AM In reply to

    Re: displaying repeating data in sharepoint

    First and foremost, thanks for your reply.

    Actually I'd not only like to push datas to "another" List, even if it's a good start. Ideally, when removing or updating the repeating table, it would also perform those actions on the "other" List. Ideally also would be to have the "other" List being a form library where I could trace back to the original Form (the one for which you provide the code). But maybe this simply can't be done ?

    Before getting into InfoPath, I was using 2 custom Lists, the main and one for the table (which had static fields, instead of having "repeating" rows). I could play around with event handlers in order to add/remove/update, so maybe is it possible to the same for InfoPath forms ?

    And concerning the code :
    - What is the KINS object ?
    - Do I really need to clearly type credentials, or is there a way to get the "current" user who is filling the form ?
    - Is there anything I need to setup to use the Web Service ? or is it automatically available to every List ?

    Thanks in advance,

    Ludovic
     

  • 08-07-2007 02:00 PM In reply to

    Re: displaying repeating data in sharepoint

    The code above will grab the data from the repeating table and push it to whatever list you want. If you want to link the two lists, you may want to add a column to your transactional (secondary) list that will store the form name so you can easily link to the saved form.

    One thing you'll want to be careful with is the update. The update function requires a primary key (The ID field in my solution) to know which record needs to be updated so make sure you have a unique identifier in your repeating table or make one on the fly. If you don't do this correctly, you will create duplicate records.

    Sorry, should have explained the KINS part. That is what I named my web reference. In your VS.Net solution, you'll have to create a web reference to the SPS web service. In order to view the available web services for SPS lists, you need to navigate to _vti_bin/lists.asmx
    For example, www.mydomain.com/_vti_bin/lists.asmx 

    It is possible to use the users credentials. I'm passing specific creds for a different reason...

    Hope that wasn't too confusing... Good luck!

     

    Shaun Nieves
    Sharepoint Manager
  • 08-08-2007 07:38 PM In reply to

    Re: displaying repeating data in sharepoint

    That was pretty clear, thanks !

    However I still have 1 question left :
    Is the code you provided supposed to go in the Form Submit code ? And if so, is it possible from there to access another Lib in order to Update/Remove items (through the same Web Service maybe) ?


     

  • 08-09-2007 09:31 AM In reply to

    Re: displaying repeating data in sharepoint

    You can place the code in the Form Submit however I like to keep my code clean and in a separate Sub and just call it on submit. I'm not sure on how many different libraries you can push data to but theoretically you should be able to push to as many as you like as long as you change the list id.

    Cheers!

    Shaun Nieves
    Sharepoint Manager
  • 08-09-2007 10:48 AM In reply to

    Re: displaying repeating data in sharepoint

    shaun.nieves:

    I'm not sure on how many different libraries you can push data to but theoretically you should be able to push to as many as you like as long as you change the list id.

    I think I've used the wrong words : actually I meant, that you could use the web service to push data to some list, but can you also "retrieve" and eventually remove an item from that list ? I'd bet you can, but I'd just like to have a little confirmation :)

     And thanks again !

    Ludovic
     

  • 08-09-2007 11:13 AM In reply to

    Re: displaying repeating data in sharepoint

    It should work but I've never tried it. Just update the xml command like below.

    <Method ID='1' Cmd = 'Delete'>

    It would work just like if you were updating. You need to know which record to update/delete

    Cheers!

    Shaun Nieves
    Sharepoint Manager
  • 08-10-2007 11:49 AM In reply to

    Re: displaying repeating data in sharepoint

    Alright, thanks a lot ! That was really helpful.

    I'll see what I can do now with this. Hope you don't mind if I get back to you in case I'm stuck :)

     
    Ludovic
     

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