Elczar Adame's Shared Points on SharePoint


 

Embedding InfoPath Form in SharePoint Page

Few weeks ago,  I was punctuated to embed an InfoPath form in SharePoint page. Immediately, I though of creating a custom web part or using SharePoint Designer. But hold on, InfoPath has already provided us this facility. By the good worth of “NO CODE” development model, it is the sensible solution:  XML Form View web part.

We initially need the following:

1.       A Form Library in SharePoint site. In this paper,  we will name our Form Library as Expense and our SharePoint site as Demonstration Portal.

2.       A browser-enabled InfoPath form published to our Expense Form Library. We will use the Sample-Expense Report and name it as Expense Report.

By the same token, we could use an administrator-approved form template, plainly uploaded and activated through Manage Form Template facility in the Application Management of our SharePoint 3.0 Central Administration. And we will get a hold of the same results.

1.       Upon completion of our two predetermined items, we going to add the following line in the <SafeControls> tag of the web.config file of our web application:

 

<SafeControl Assembly=”Microsoft.Office.InfoPath.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” Namespace=”Microsoft.Office.InfoPath.Server.Controls” TypeName=”*” Safe=”True” />

 

NOTE: The web.config file of our web application is located at C:\Inetpub\wwwroot\wss\

VirtualDirectories\web application port number.

 

2.       Let us open our Demonstration Portal. Under Site Actions, click Site Settings.

3.       In the Site Settings page, as illustrated below, click Web Part Gallery link.

4.       In the Web Part Gallery page, click New. We will be redirected to the Web Part Gallery : New Web Parts facility.

5.       In the Web Part Gallery : New Web Parts part, check Microsoft.Office.InfoPath.Server.Controls.XmlFormView. Then,  click Populate Gallery. We will be redirected again to the Web Part Gallery page where we can verify the inclusion of XmlFormView.webpart. Below is the illustration.

6.       At this instant, we will employ the web part to put on view our Expense Report form. Let us open our Expense Form Library.

7.       In the Site Actions, click Edit Page. As illustrated below,  the page will be set to Edit Mode.

8.       Click the Add a Web Part link, and the Add Web Part to Main web page dialog will be displayed.

9.       Check the XmlFormView, normally under miscellaneous section, then click OK. If we will be prompted by an error message of InfoPath, we have nothing to worry. Just click Close.

10.   Now, we will modify our XmlFormView web part. To do this, click Edit, then Modify Shared Web Part.

11.   As illustrated below, let us set the following items,  then click OK.

a.       Editing Status : Editing

b.      Xsn Location : Please refer to the notations below.

NOTE:  The Xsn Location varies on the publishing approach we have employed.

a.       If we have published  our  form template directly to a specific Form Library, similar with our case, we can check the location from Site Actions, then Site Settings, then Site Libraries and Lists, then Customize Form Library, then click the corresponding Form Content Type, then Advance Settings, and we will have the URL of our form template. It is http://Server Name:Port Number/Form Library Name/forms/template.xsn.

b.      If we have published, however, an administrator-approved form template through the Manage Form Template facility, we can check the location from Site Actions, then Site Settings, then Site Content Types, then the corresponding Form Template Name – it is normally under the Microsoft Office InfoPath section, then Advanced Settings, and we will have the URL of our form template. It is http://Server Name:Port Number/FormServerTemplates/Form Name.xsn.

12.   As a final task, we will close the Expense list view, then Exit Edit Mode to have the final output.

I hope it will help you!

 
 
 
 
 
Advertisements

Comments on: "Embedding InfoPath Form in SharePoint Page" (8)

  1. Peter KeyTech said:

    Finally someone with a clear explanation for embedding forms. And without creating a webpart! Thx!

  2. Crhsitohper said:

    Excellent. Been hunting for exactly this. Thank you.

  3. I was very impressed with this information, so much so I tried impleting it per your instructions on my developmetn MOSS server.
     
    However, it didn\’t work for me.  I modifed the webconfig file, and then tried updating the webpart gallery, but the XMLFormView webpart never appears.
     
    Is there anything else I can try to make it work?
     
    richard (at) lbrc.org

  4. Thanks guys for the appreciation…For richardb20, I am very sorry…please verify the additions you have made in your web.config file for <SafeControl>.

  5. loved it worked beautifully

  6. Thanks the4u2cnnv! I have posted a related piece at http://elczara.spaces.live.com/blog/cns!554EC06D366AC9D5!341.entry.

  7. Jorge De La Garza said:

    As a user of SharePoint, I don\’t have access to the server data to edit. After hours of trying to figure things out, I finally realized that I could use the "Content Editor Web Part" and use the source code feature to embed  the form using the  <iframe> html coding. <iframe width="800" src=" ( open a new for by using the "fill out a new form" link when you click on new. use the URL on the fresh form to place in this location)"></iframe>Of course, adjust the width & height to your specific settings.Hope this helps!

  8. Thanks Jorge for sharing your idea.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: