SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

InfoPath form viewer webpart

MOSS 2007 now provides a great service, InfoPath Forms Services

"InfoPath Forms Services is a server technology that makes it possible for users to fill out InfoPath forms in a Web browser. Users don't have to have InfoPath installed on their computer to fill out this type of form, nor are they required to download anything extra from the Web. All they need is access to a browser, such as Windows Internet Explorer, Apple Safari, or Mozilla Firefox."

The published InfoPath forms are rendered and white blank page which most of the time will not follow your portal main theme, there are ways to integrate the form inside the portal

InfoPath form viewer webpart main features:

  • render the InfoPath form in iframe
  • ability to add html code to be rendered
  • set query string keys to be appended to the form url and consumed by the form

Required configurations:

  • Html code: html code that contain iframe with macro that will be replaced by the form URL
    for example:

<div class="EForms">

<div class="EForms2">

<div class="EForms3">

<h5>form title</h5>

<div style ="text-align:center;margin-top:10px;">

<iframe src="%formurl%" width=99% scrolling=no frameborder=0 marginwidth=0 marginheight=0 height=600 >info path here</iframe>

</div>

</div>

</div>

</div>

  • Form URL: the actual form url
    for example:http://moss.dep/English/_layouts/FormServer.aspx?XsnLocation=http://moss.dep/English/Meeting%20Request%20English/Forms/template.xsn&SaveLocation=http%3A%2F%2Fmoss%2Edep%2FEnglish%2FMeeting%20Request%20English&Source=http%3A%2F%2Fmoss%2Edep%2FEnglish%2FMeeting%2520Request%2520English%2FForms%2FAllItems%2Easpx&DefaultItemOpen=1
  • Form parameters: query string keys to be read comma separated

Package contains:

  • InfoPathFormViewer.wsp: solution file for the webpart
  • setupInfoPathFormViewer.bat: batch file to be executed from one web front end node (edit the batch file and replace http://londonmoss with your portal url)

you can download the package from here

if anyone have comments please send to me.

Hope you like it Big Smile


Posted 02-25-2008 3:54 PM by Marwan Tarek

Comments

Essam wrote re: InfoPath form viewer webpart
on 03-03-2008 11:43 AM

Is there any WinForms viewer for InfoPath ?

Marwan Tarek wrote re: InfoPath form viewer webpart
on 03-03-2008 2:53 PM

Yes, check this article

msdn2.microsoft.com/.../aa701079.aspx

Ram wrote re: InfoPath form viewer webpart
on 04-01-2008 2:02 AM

hi marwan,

A very good article indeed, in essence what we are doing is Rendering the INFOPATH XSN file which is uploaded in the Forms Library.

Could you direct me to any article which explains how to render an xsn file and what parameters should eb taken care of while doing the same.

Regards

Ram

Linda wrote re: InfoPath form viewer webpart
on 04-09-2008 4:24 PM

Marwan,

I got the XMLFormView web part to work, but I can't get the InfoPathFormViewer to work.  Could you give a step-by-step on how to configure this web part?  I already installed the web part to SharePoint and published an InfoPath form to a SharePoint library, but I'm not sure about what to enter for HTML and URL.  Could you please be more specific on what goes on the HTML and URL of the web part?  Thanks.  Linda

Ahmed Kamel wrote re: InfoPath form viewer webpart
on 04-13-2008 7:16 AM

Hi Marwan,

i tried your solution and it works fine but the problem is i am using source parameter to redirect to user requests page in ur control it works fine but the requests page appear in the iframe :S, so I am trying to use a page viewer web part and give it the form url with the parameters and making it redirect to a redirect page and i am trying to set the target for the redirection.

Thanks,

Ahmed Kamel wrote re: InfoPath form viewer webpart
on 04-15-2008 3:54 AM

Dear Marwan, I am trying to submit my infopath form to a sharepoint library and save it just the user click submit. it works fine but i want the form to submit not to particular form library i want it to submit to the parent what ever the library name is.

your help will be appreciated.

Thanks,

Anders wrote re: InfoPath form viewer webpart
on 04-17-2008 6:54 AM

Hi Marwan,

I can get this to work. probably a configuration error. What do I do wrong here:

HTML code:

<div class="EForms"> <div class="EForms2"> <div class="EForms3"> <h5>Test</h5> <div style ="text-align:center;margin-top:10px;"> <iframe src="%formurl%" width=99% scrolling=yes frameborder=0 marginwidth=0 marginheight=0 height=700 >Template4.xsn</iframe> </div> </div> </div> </div>

Form URL

moss/.../Template4.xsn

Can you please help

Anders wrote re: InfoPath form viewer webpart
on 04-17-2008 7:27 AM

Hello Marwan,

I cant get it to work. Infopath gets activated but not in the iframe. It is probably a configuration error:

HTML code:

<div class="EForms"> <div class="EForms2"> <div class="EForms3"> <h5>Test</h5> <div style ="text-align:center;margin-top:10px;"> <iframe src="%formurl%" width=99% scrolling=yes frameborder=0 marginwidth=0 marginheight=0 height=700 >Template4.xsn</iframe> </div> </div> </div> </div>

Form Url:

moss/.../Template4.xsn

Can you help me

Gunasekaran wrote re: InfoPath form viewer webpart
on 04-23-2008 6:40 AM

hi,

it's very cool example, i tried the Iframe option to open the Browser enabled infopath form with redirect option.

without using Iframe it will redirect to the target page. but with in Iframe, it shows error "Permission Denied".

Any Suggestions

Thanks,

Brij wrote re: InfoPath form viewer webpart
on 04-24-2008 5:24 PM

Hello Marwan,

Can we use this web part for InfoPath form editing? We have MOSS 2007 with MS Office 2003 and I was wondering if we can edit published InfoPath forms by browsing the SharePoint site with your web part on it.

InfoPath 2007 supports publishing browser compatible InfoPath forms but InfoPath 2003 does not and everybody in our organization doesn't have InfoPath 2003 installed to edit the published InfoPath forms.

Is it possible to use your web part for such capabilities?

Linda,

Please specify HTML code as follows:

<div style ="text-align:center;margin-top:10px;">

<iframe src="%formurl%" width=99% scrolling=no frameborder=0 marginwidth=0 marginheight=0 height=600 >info path here</iframe>

</div>

Please replace %formurl% with your actual url, where you have InfoPath form.

Here is how my HTML code looks like,

<div class="EForms3"><h5>Form Title</h5><div style ="text-align:center;margin-top:10px;"><iframe src="sharepoint.domain.com/.../ChangeOrderForm.mht"">sharepoint.domain.com/.../formserver.aspx width=99% scrolling=no frameborder=0 marginwidth=0 marginheight=0 height=600 >infopath here</iframe></div></div></div></div>

where ITSite is the top level IT Site in our SharePoint Server farm and ChangeOrderForm.mht is the InfoPath form exported to IPFL Forms Library of IT Site.

I have URL = sharepoint.domain.com/.../ChangeOrderForm.mht

Note: I have modified actual URL to keep the privacy.

I am not sure if I have configured it correctly or not but atleast it displays the InfoPath form. May be Marwan can throw some more light :-)

Thanks

Brij wrote re: InfoPath form viewer webpart
on 04-25-2008 11:53 AM

Hello Marwan,

Can we use your web part for editing or filling up Info Path forms? We have MOSS 2007 installed with MS Office 2003 and we can not publish browser enabled Info Path forms using Info Path 2003 so I was wondering if we can use your web part to fill up Info Path forms.

Linda,

Please use appropriate HTML code and URL to make this web part working.

For example, you can use Marwan's  HTML code with little modification,

<div style ="text-align:center;margin-top:10px;">

<iframe src="%formurl%" width=99% scrolling=no frameborder=0 marginwidth=0 marginheight=0 height=600 >info path here</iframe>

</div>

Please modify %formurl% to the url, where you have Info Path form.

I have exported InfoPath form to one of forms library on SharePoint site and I have replaced "%formurl%" to "sharepoint.domain.com/.../ChangeOrderForm.mht"">sharepoint.domain.com/.../FormServer.aspx

Also, I have URL = sharepoint.domain.com/.../ChangeOrderForm.mht

I am not sure if I have configured it correctly or not but at least it displays the Info Path form using the web part. May be Marwan can throw some more light on it. Thanks.

Brij wrote re: InfoPath form viewer webpart
on 04-28-2008 7:02 PM

Can we use your web part to edit or fill up the Info Path forms? We have MOSS 2007 with MS Office 2003 and Info Path 2003 doesn't have capabilities of publishing browser enabled forms. So I was wondering if we can use your web part to view and edit(fill up) Info Path forms in browser and with out using Info Path 2003.

Thanks

Roy wrote re: InfoPath form viewer webpart
on 05-08-2008 9:21 AM

I am most interested in your webpart.  But I was wondering about the webpart addition or safe control setting.  Does it have a key token.

chandrika wrote re: InfoPath form viewer webpart
on 05-12-2008 12:57 AM

How can i open the submitted infopath form from sharepoint library in form viewer webpart?

cookie wrote re: InfoPath form viewer webpart
on 07-07-2008 1:43 AM

Can this work with InfoPath 2003? Maybe it's the reason, why I can't get it to work properly.

I tried following the steps.. got up to installing the InfoPathFormViewer however I don't see the options for "Features" or "Data Binding" under Modify Shared Web Part... I continued on to adding in the HTML code and Form URL; with the web part showing "The form has been closed".  

And that's where I am atm. Would you be able to point in the right direction from here? Thanks in advance

Marwan Tarek wrote re: InfoPath form viewer webpart
on 07-09-2008 12:55 PM

Hello,

sorry for being away from this comment for  a long time.

This web part was totally developed to view InfoPath forms developed using InfoPath 2007 and published to SharePoint forms services.

i will try to post a more detailed on how this web part works and how to configure it.

Marwan

Jackie wrote re: InfoPath form viewer webpart
on 09-11-2008 7:00 PM

I have installed the webpart, and it seems to be working, but it doesn't allow me to open the infopath file within the webpart.  It prompts me to open infopath.  My goal was the have users complete the form without having infopath installed on their machines.  Is this possible?  Thanks so much.

Marwan Tarek wrote re: InfoPath form viewer webpart
on 09-14-2008 8:10 AM

Hi Jackie,

you need to configure the infopath forms services first

check this link to give a clue

blogs.msdn.com/.../configuration-tasks-needs-to-be-done-to-work-with-infopath-forms-services-and-browser-forms.aspx

Mike wrote re: InfoPath form viewer webpart
on 09-15-2008 3:49 AM

Hi Marwan,

The web part is working great. What I want to do is edit an existing form in your web part. Is this possible.

I have a few forms in an form library. When I want to view or edit an existing form it opens the form "stand-alone" I want to view it enbedded in a sharepoint page.

Thanks, Mike

JasonD wrote re: InfoPath form viewer webpart
on 10-09-2008 9:20 AM

I suggest not using the included BAT file but rather STSADM so that you can include this webpart in the GAC.

I was able to resolve an "Unsafe webpart" error by using this method.

In the Trenches wrote InfoPath and MOSS 2007 Useful Links
on 10-11-2008 6:46 AM
James Bruiners wrote re: InfoPath form viewer webpart
on 11-01-2008 5:57 PM

Hi Great Article,

I want to send parameters from a sharepoint list to a infopath (as webpart) in the same list view. For example a infopath webpart that consumes a connections etiher from query string or just using some of the filter web parts, but so far im not having much sucess.

Any ideas?

James

Marwan Tarek wrote re: InfoPath form viewer webpart
on 11-02-2008 1:14 AM

Hi James,

for query sting paramters this web part is designed to consume paramters sent as query string just follow the deployment and description if you faced issues send comment, for using filters i never tried it before :(

--Marwan

InfoJetSoft wrote re: InfoPath form viewer webpart
on 01-09-2009 3:01 AM

InfoJet EditPart - Edit InfoPath Web Forms.

http://www.infojetsoft.com

Web Part Viewer (almost any document) wrote re: InfoPath form viewer webpart
on 01-16-2009 4:46 AM

Hi marwan,

I have just finished working on a new webpart that uses the Content Editor webpart as a Iframe, then editing the XSLT to aim (either via click or scroll over) a parameter to the IFRAME from any list.

Hence you can get a preview of the document (office, PDF, Infopath...)

To use Infopath in this fashion you do need the form to be browser enabled and have MOSS Forms Services, but check out my blog for a walkthough on how to do this.

sharepoint-oba-talk.blogspot.com

Happy new year

James

Infopath Forms wrote re: InfoPath form viewer webpart
on 01-16-2009 3:49 PM

Hi Marwan,

Excellent post. Looking forward to your post with more details on how this web part works and how to configure it.

Brian

Rendering a Infopath form published to Sharepoint in a webpart | keyongtech wrote Rendering a Infopath form published to Sharepoint in a webpart | keyongtech
on 01-18-2009 10:29 AM

Pingback from  Rendering a Infopath form published to Sharepoint in a webpart | keyongtech

Sana wrote re: InfoPath form viewer webpart
on 04-08-2009 6:19 AM

Hi Marwan,

I am new to sharepoint. I saw your infopath form webpart.

Can you please guide me where to configure HTML code and URL ?

Eldar wrote re: InfoPath form viewer webpart
on 05-05-2009 9:48 PM

Thanks, Marwan.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.