Search This Blog

Thursday, February 12, 2015

InfoPath forms in SharePoint 2010 (Document based and list based forms) Step by Step samples and comparison (Part2)

What we will do in this post is to create SharePoint list and to customize the list input form using InfoPath then we will have quick comparison between the two type of list form.
1- Navigate to SharePoint portal and From home page Site action > View all site content
2- Click on Create clip_image001
3- Click on List > Custom List > enter the list name(in our case feedback list) > Create
4clip_image003
4- Click on Create Column clip_image004
5- Enter the name of the column (Title and Feedback) and choose Multiple lines of text then click ok
clip_image006
6- Now go to Microsoft Info path designer 2010 and create a new file as follow
7- Click on new > SharePoint List > Design Form
clip_image008
8- Enter portal URL, click Next
clip_image009
9- Choose Customize an existing SharePoint List , choose (Feedback List) then click Next. Wait while connecting to the data source then click Finish
image
10 – The feedback Form will be automatically generated
clip_image011
12- Since we don’t need the attachment field, right click on the attachment row Delete > Delete row
clip_image013
13 – Click on File > Publish > SharePoint List
clip_image015
14 –After the Publish is done Click on open SharePoint List in browser to view the form in browser
15 – Browse to list (Feedback list Library) then click on clip_image021 to open the form; our customized form is getting displayed.
clip_image025
16 –After you save your feedback,browse to the library (Feedback list in our case)
clip_image027
The saved data is getting displayed on the list.
Now after we have finished creating sample form using the two types ,which form type should I use in my application?
Before deciding which one is better for you, let’s discuss some differences between the two types:
The first difference  is that the schema structure for a list based form is flat; it is not possible to build hierarchical information sets with grouped and nested items. And you can’t apply repeating, optional, or choice behavior to individual elements or groups; the second difference is the set of controls available in a list form . Figures below shows the available form controls that can be used in each type.
clip_image029
Figure: List based form controls
Untitled
Figure: Document based form controls
Other difference is that List form populates the columns in the host list only in other side document based form generates an XML document containing the information entered and gathered in the form based on the schema, so if your data needs to be archived in files you can use document based forms then download the captured data in the documents themselves, in other hand you can use SharePoint workspace to have offline copy of list data in case you have used list based forms.
List based forms cannot contain managed code or repeating/nested data. so If the your solution requires managed code or complex data structures in forms it’s better to use a form based forms. Form designers can add managed code to document based forms by using VSTA Visual Studio Tools for Applications  . VSTA is an optional installation component available in InfoPath 2010 Setup. finally if Digital signatures is a requirement then document based form wines.
To summarize ; I think the following table from this article is useful to decide which type to use in your solution:

QuestionDocument based FormList based form
What is the structure of the form data?HierarchicalFlat
How is form data stored?XML filesList items
Is there support for custom code?YesNo
What offline client is available?InfoPath fillerSharePoint Workspace
Is there support for digital signatures?YesNo

No comments:

Post a Comment