How to open XML file in SharePoint Library - InfoPath Dev
in

InfoPath Dev

How to open XML file in SharePoint Library

Last post 03-05-2006 09:30 PM by liorlankri. 15 replies.
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts: Previous Next
  • 02-18-2006 11:00 PM

    How to open XML file in SharePoint Library

    I need code in C# (My form code behinf) that open XML file that located on SharePoint server library (by given SharePoint server name and file name).
    And code to read specific elements value that in the xml file (By given Tag name) after I open the XML file

  • 02-19-2006 01:00 PM In reply to

    Re: How to open XML file in SharePoint Library

    You can do this without code by just adding a SharePoint data connection. When you publish the form that you want to read from the last step will ask you what columns (if any) you would like to promote to SharePoint columns, and once you promote these columns you should be able to read the data from them by adding a SharePoint data connection to that document library.

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 02-21-2006 11:35 PM In reply to

    Re: How to open XML file in SharePoint Library

    No good for me. I will explain What I want to do.
    I have an InfopPath form that some of it's fields are IDNumber, FirstName and LastName. Each file witch been saved (on SharePoint Library) get the file name witch is the IDNumber value + ".xml" . I want that after the user enter IDNumber (in new form) the code will search XML file (in the SharePoint Library)that the it's name match to this IDNumber value and if the file found I need to get from it the values of FirstName and LastName. I'm sure I need code for it. Am I righ?
    How to do this??
  • 02-24-2006 12:13 AM In reply to

    Re: How to open XML file in SharePoint Library

    Promote the properties of Firstname and Lastname and use the SharePoint list adapter. No code required but you will need a filter on the file name to pull in the first name and last name.

    Patrick Halstead [InfoPath MVP]
    InfoPath Dev Seattle
    Patrick Halstead
    Project Manager at Qdabra
  • 02-24-2006 11:45 AM In reply to

    Re: How to open XML file in SharePoint Library

    Do you have Example to this? How to use the SharePoint List Adapter?

    Still dont understand how to search file name that match to the IDnumber value!!!
  • 02-26-2006 04:04 AM In reply to

    Re: How to open XML file in SharePoint Library

    I nees code example to:
    1) search file name in the DhsrePoint Library (should it be in the code behinde or will I nedd Web Service to do this?)
    2) I will use the SharePoint list adapter to get the firstname and last name that are culomns in the list. How to use the SharePoint list adapter for this?
  • 02-26-2006 01:18 PM In reply to

    Re: How to open XML file in SharePoint Library

    Hi liorlankri

    im a bit confused on what exactly it is you want to achieve, so ill try and sketch what i *think* it is you want:

    you have an existing IP list of employees that -amongst other things- contains employee name and ID. The employees are in a sharepoint list where the employee ID matches the filename.

    In another IP form you want the user to extract information about the employees.

    Is this correct?

    If so, there is really no need for managed code.

    You mention that you then want the user of the form to enter an employee ID and then get the name of the employee. Sure this can be done, but wouldnt it be easier for the user, if they could just select the name from a dropdown? Unless the list is huge, this would be more intuitive for the user.

    To populate a dropdown with names from the sharepoint employee list do this:

    Tools > Data connections > Add > Recieve data > Sharepoint library > url to site/area that contains form list > Select the fields you need (firstname, lastname and ID if you want to filter on ID -not neccesary if you just populate a dropdown). Give the data connection a name and finish the wizard.

    Now place a dropdown control on the form and double click it to get properties. Select Data > List box entries > Look up from sharepoint list > select the repeating section of your employee IP form that contains name info > select the value and display name fields from the repeating section.

    When you preview the form you will see the names in the dropdown ready to be selected.

    This method will let your users extract any field from your saved IP forms.

    hth
  • 02-26-2006 02:07 PM In reply to

    Re: How to open XML file in SharePoint Library

    Hi AnderSR! your sulotion not good foe me. I dont want the name to be dropdown list because not for each there is already form with this ID. I need to search if exist and only f exist than to provide first and last naems!!!!

    how to to it???
  • 02-27-2006 12:38 AM In reply to

    Re: How to open XML file in SharePoint Library

    Hi,

    again theres several ways to do this.
    basicly its done the same way as above, but as Patrick mention you need to add a filter:

    First create the Data Source as described above.
    Then create a text box called fx empID.

    Now go to your secondary data source (emp or what you called it) and find employeename. Rightclick and select the way you want to represent the name (repeating textbox, bullets eg).

    Go to properties on the textbox of the newly created repeating control and select

    Display > Conditional formatting > Add > employeeID (or whatever your ID is called in data source) > is not equal to > empID > Hide this control > OK > OK > OK

    now preview and viola..

    hth
  • 02-27-2006 02:09 AM In reply to

    Re: How to open XML file in SharePoint Library

    It seems that you didnt understand what I need. Never mind....

    thank you
  • 02-27-2006 12:06 PM In reply to

    Re: How to open XML file in SharePoint Library

    Well try and explain it in more detail, and we will give it a go.
  • 02-27-2006 10:23 PM In reply to

    Re: How to open XML file in SharePoint Library

    I will try to explain:

    I have an InfoPath form that contain those fields:
    IDnumber,FirstName,LastName,Address, and other fields.
    My form been bublished to a SharePoint Library (forms folder) and each new form that been fill out is submited to this SharePoint folder (Main Submit). each form that been submited get the file name by this formula:
    concat(IDNumber, "_", today())
    I can fill out many form to same IDnumber.
    I want that in case that I fill out a form the follwing will happen:

    1) I start with the IDnumber, if there is alredy file (in the SharePoint Library) that contain this IDnumber, so it will put the firstName, LastName and Address values on their fields (get exist values from exist form). If not, I will fill it regular and submit the form.
    That's why I cant use Dropdown list for firstName,LastName and Address!!
    2) because my request in 1, I need to write code on the OnAfterChange event of the IDnumber field. In the code I will operate Web service (I will make data connection to this WS) that recive the IDnumber as Parameter an it will search file in the SharePoint Library that contain this IDnumber value, and if find, the Web Service return the valuse of firsname,Lastname and Address and in the form's code (OnAfterChange event) I will fill those values in the form.

    I need few things from you for this:
    1) Tell me if the way I think to do it is right?
    2) If yes, I need Example of how to write the WebService (in c#) that get one paramete (IDnumber) and operate search in the SharePoint Library (forms list) and return the value I need (the values will be culomns of the list).

    3) How to connect the form's code (VBscript) to the Data connectin that recive data from the web sercive. How to call the WS from the code?

    I hope that is good
    Thanks
  • 02-28-2006 01:52 PM In reply to

    Re: How to open XML file in SharePoint Library

    Hi

    1) the approach sounds as it will work, assuming you dont have somewhere more obvious to get the names from (database etc)
    2) as far as i can see, you should be able to recieve the data from a standard Sharepoint web service GetListItems web method of the lists.asmx web service. Read one of my posts about this here
    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=1664&SearchTerms=getlistitems

    3) check the SDK for samples on this or search this forum/how to's. Sorry i dont do much VBscript these days, so im a bit rusty :-s

    hth
  • 03-01-2006 03:59 AM In reply to

    Re: How to open XML file in SharePoint Library

    Tell me if I understand you.
    You are telling me that I dont need to write my own Web Service because I can use the standard Sharepoint web service GetListItems web method of the lists.asmx web service.

    as I understand, all I need is to create Data Connection to this standard web service.
    1)Tell me if I right?
    2)If yes, I didnt understand how the GetListItems web method work. Does it get parametrs (I need to search Items according to the IDnumber input value!!!)??
    How I determin which data I want it return me?
    AND..... How to operate this data connection from the CODE OF MY FORM?????

    I need good example for this.

    PLEAS help me with this, It's very URGENT!!!!!!
  • 03-01-2006 04:41 AM In reply to

    Re: How to open XML file in SharePoint Library

    Hi

    did you read the link to the posting?

    SPS has a number of web services to manupulate lists, upload images, user info etc.

    Check out the reference for the webmethod GetListItems here
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spptsdk/html/soapmListsGetListItems_SV01034350.asp

    As you can read at the reference, you can give the webmethod a CAML query in xml format where you can filter on your ID.

    I'm not gonna code this for you, youll have to to that yourself;-), but read the above and experiment in querying the web service to achieve the result you need.

    As both Patrick and me stated, you could also connect this list as a secondary data source, and then manipulate the results in your code using the sharepointListAdapter (look it up in the IP SDK).

    hth
Page 1 of 2 (16 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.