Saturday, December 23, 2006

Opening Infopath forms in Browser directly from a link

Many people have faced the problem of not been able to open Infopath form in browser in

MOSS 2007 directly from a link to .xsn file other than Form library itself. If the user tries to open an

.xsn file from the form library which is configured to render the form in the browser, the user

gets a open/save dialog box instead of a form being rendered in browser.

This is because the links clicked inside a form library or document library behave differently

than the link to same target clicked on any other page. An Office compatible client like Word 2007,

Excel 2007, InfoPath 2007 is smart enough to detect that the link is opened from Document library and

when it detects such a link click, it automatically opens the document directly from the document library

without showing the open/save dialog box in the browser. If you try to modify the document, the

document will be saved directly to the document library. This behavior of document library is identical

to that of normal Windows folder.

The solution to this problem is to have a link to URL (when the form is rendered in browser) rather

than having link to xsn file itself.

This solution is not suitable if you have a link coming in dynamically for ex. for each form in form library,

there is a link in your custom webpart. However you can easily avoid this problem by writing a simple

code which will incorporate the filename of your form in the URL.

1 comment:

Anonymous said...

Do you have an example of code to support your dialog?