chris beckett | sharepoint technology specialist (206) 965-8257 | [email protected](206)...

18
InfoPath Forms Services Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | [email protected] | www.sharepointbits.com

Upload: chelsea-jeffrey

Post on 31-Mar-2015

228 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

InfoPath Forms Services

Chris Beckett | SharePoint Technology Specialist(206) 965-8257 | [email protected] | www.sharepointbits.com

Page 2: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

2Agenda

1. Forms Services Overview2. Demo – Publishing and Viewing a Simple Form with Form Services3. Differences between InfoPath Rich and Web Forms4. Advantages of Data Connections5. Demo – Using a Data Connection Library6. InfoPath Security Modes and Publishing Alternatives7. Demo – Farm Data Connection Library / Administrator-Approved Form8. InfoPath Forms Services Query Parameters9. Demo – Using Custom Query Parameters with VSTO10. Mobile Forms11. Demo – Viewing a Mobile Form12. Resources13. Q&A

Page 3: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

3InfoPath Forms Services Overview

• The InfoPath Forms Services technology is available in the Microsoft Office SharePoint Server 2007 Enterprise CAL and also, separately, in Microsoft Office Forms Server 2007.

• Allows rendering InfoPath Forms in a Browser• InfoPath client is not required to be installed on the client machine• Cross-Browser support for IE, Safari, Firefox

Page 4: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

4Demo – Publishing a Form

An introduction to publishing InfoPath forms for display in InfoPath Form Services:

1. Open Sample Template2. Set Compatibility for Browser3. Set Forms Options4. Save Locally5. Publish to SharePoint (Create New

Library)6. Update Library to display in browser7. Demonstrate form displaying in

browser

Page 5: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

5InfoPath Client vs. Forms Services

Controls that work with Forms Services:

• Text Box• Rich Text Box (Partial)• List Box• Drop-Down List Box• Date Picker• Check Box• Option Button• Button• Section• Optional Section• Repeating Section• Repeating Table• File Attachment• Hyperlink• Expression Box

Controls that require InfoPath client:

• ActiveX Control

• Bulleted List Control

• Choice Group / Section

• Combo Box

• Horizontal Region / Repeating Table

• Ink Picture Control

• Master/Detail Control

• Multiple-Selection List Box

• Numbered List Control

• Picture Control

• Plain List Control

• Repeating Choice Group

• Repeating Recursive Section

• Scrolling Region

• Vertical Label

Page 6: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

6InfoPath Features not supported by Forms

• Filters• Submitting data to a database• Submitting ADO.NET Change Dataset• Alerts that display dialog boxes• Rules to open a new form• Digitally signing entire form• XSL customizations with xd:preserve• Data Connections across site collections• Custom code to save forms• Custom code to merge data• Legacy Code using InfoPath.SemiTrust• User Roles / Current User Role• Placeholder Text in Controls• Custom Task Panes• Prompting users to save changes when

closing a form• Rules to display a dialog box

• Protected Views

• Word-Based Print Views

• Undo / Redo

• Check Spelling

• AutoComplete

• Information Rights Management

• Send to Mail Recipient

• Merge Forms

• Export to Excel

• COM Add-Ins

• There are also differences between what classes and members of the Microsoft.Office.Infopath namespace can be used with Forms Services

Page 7: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

7Data Connections

• Xml file in the Universal Data Connection V2 Format• Abstracts connection details from the InfoPath Form• Saved to a special library called a “Data Connection Library”• Can be deployed at a site, or farm-level• Allows browser-based forms to access Web Services securely, even

across domains (with configuration)• Allows submitting forms across Site Collections and Web Applications• Configuration managed from Central Administration under

Application Settings

Page 8: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

8Demo – Data Connection Libraries

Using data connection libraries to improve the portability of InfoPath Forms:

1. Create a custom list to hold Trip Class options

2. Add a receive data connection to the new list

3. Create a Data Connection Library4. Create a UDCv2 file pointing to the Trip

Class list. Upload to the data connection library.

5. Add a receive data connection to the new UDC in the data connection library.

6. Review form manifest to demonstrate that data connections do not hard-code connection information into the form.

7. Republish the form as a Content Type8. Create new form library and add new

content type9. Display the form and demonstrate data

being retrieved through data connection library

Page 9: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

9Form Security Modes

USER FORMS / DOMAIN-TRUST• Forms published directly to SharePoint

Form Libraries or Content Types• Forms that use Site Collection Data

Connection Libraries• Local to site collection – if published to

another site collection completely independent copy (hard to manage changes)

ADMIN-APPROVED / FULL-TRUST• Forms with code-behind• Forms that use Data Connections from

Central Administration• Can be used in multiple site

collections and web applications• Single place to make changes• Additional overhead to publishing

process

Page 10: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

10Demo – Full Trust Forms

Use a Farm-Level data connection library with an Administrator-Approved Form:

1. Open Central Administration and upload UDC file to Farm Data Connection Library

2. Add a receive data connection to the new UDC in the data connection library – specify “Centrally Managed connection library”

3. Republish the form as an Administrator-Approved Form

4. Open Central Administration and upload form template. Publish to demo site collection.

5. Open demo site and display published form template and new auto-generated content type.

Page 11: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

11Invoking Forms by URL

• URL that references a form template (*.xsn) or form file (*.xml)• URL that references the built-in FormServer.aspx Web Page• Custom Page containing the XmlFormView control

http://ServerName/sites/SiteCollection/FormLibrary/Form1.xml?OpenIn=Browserhttp://ServerName/sites/SiteCollection/_layouts/FormServer.aspx?XmlLocation=~sitecollection/FormLibrary/Form1.xmlhttp://ServerName/sites/SiteCollection/FormLibrary/Forms/template.xsn?NoRedirect=true

Parameter Name Description Allowed Values

XmlLocation Used to open an existing form. The XmlLocation and XsnLocation properties are mutually exclusive; specifying values for both parameters will result in an error.

A valid url to a form file (.xml) in the same site collection.

XsnLocation Used to open a new form based on a form template. A valid URL to a form template file (.xsn) published on the same site collection.

OpenIn Used to specify how the form will be rendered. Browser | Client |PreferClient | Mobile

Source The location to which the user will be redirected when the form is closed. The URL must be in the same site collection or an error will be returned.

A valid URL in the same site collection as the form.

Options DisableSave is the only allowed value. It hides the Save and Save As buttons and disables saving the form when it is rendered in the browser.

DisableSave

SaveLocation A Save As dialog box is displayed prompting the user for a filename, and then it is saved in the specified folder. An error is returned if the specified folder does not exist.

Any valid folder location on the site collection.

NoRedirect Does not redirect to FormServer.aspx for client detection or rendering in the browser. Default value is false. If true and an XmlLocation or XsnLocation is specified, a File Download dialog is displayed when using Internet Explorer.

False (default) or True

Page 12: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

12Passing Parameters to Forms

• Passes any additional query parameters not recognized by InfoPath Forms Services to browser form as Input Parameters in the Form Loading event.

http://server/sites/team/forms/DeptReport.xsn?Dept=Accounting

Reading Input Parameters for Form Opened with URLpublic void FormEvents_Loading(object sender, LoadingEventArgs e){ string purpose = e.InputParameters[“Purpose"]; XPathNavigator xmlNav = CreateNavigator(); xmlNav.SelectSingleNode("/my:travelRequest/my:purpose“, NamespaceManager).SetValue(purpose);}

Reading Input Parameters for Form Opened in XmlFormView WebPartpublic void FormEvents_Loading(object sender, LoadingEventArgs e){ string param = HttpContext.Current.Request.Params[“myParam"]; …}

• Query parameters allow InfoPath to be invoked from links, the Business Data Catalog, a DataFormView on a custom SharePoint Designer page, etc.

Page 13: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

13Demo – Forms Services Query Parameters

Demonstrate supported and custom query parameters for InfoPath Web Forms:

1. Open the demo site and browse to Form Templates

2. Display the form template using Form Services Query Parameters…\TravelRequest.xsn?OpenIn=Browser

3. Switch to the InfoPath Form4. Open VSTO by selecting Tools >

Programming > Loading Event from InfoPath

5. Add code to copy the “Purpose” parameter to the Business Purpose field

6. Republish the form as an Administrator-Approved Form

7. Open the demo site and create a new form.

8. Update the URL to add our new custom query parameter and refresh the browser

9. Display how the query parameter became the value for the form field

Page 14: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

14Mobile Forms

Mobile Form Design Differences

• ASP.NET Controls replaced with ASP.NET Mobile Controls

• HTML Tables and CSS not supported by some mobile browsers – visual fidelity is not guaranteed

• Mobile representation rendered during publishing – may look different on different devices

• Only support a sub-set of browser controls:

• Text Box• List Box• Check Box• Drop-Down List Box• Repeating Section• Expression Box• Date Picker• Buttons

Recommendations

• Used buttons and multiple views to organize controls for small screens

• Use only supported controls to minimize rendering inconsistencies

• Minimize dynamic data queries that require round-trips to the server

Page 15: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

15Demo – Mobile Forms

Demonstrate rendering a form in a mobile device:

1. Start the Windows Mobile 6 Emulator2. Start Pocket IE3. Browse to demo site mobile view4. Open the “BreakfastParis” file5. Demonstrate the form rendering in a

mobile device

Page 16: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

16Forms Services Configuration

• Located in Central Administration > Applications > InfoPath Forms Services• Allows configuration of farm settings for Forms Services• Can be used to enforce secure policies around form connections to data, etc• Session State Size – Large File Upload support

• Should publishing browser forms be restricted to Administrators?

• Does access to data sources need to be secure?

• Is cross-domain access to data allowed?

Page 17: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

17Resources

• Microsoft Office Forms Server 2007 SDKhttp://msdn.microsoft.com/en-us/library/ms772301.aspx

• InfoPath Forms Server 2007 – An Essential Guide!http://www.marclenferna.com/blog/archive/2008/10/31/infopath-forms-server-2007---an-essential-guide.aspx

• TechNet Office System Tech Center – Microsoft Office Forms Server 2007http://technet.microsoft.com/en-us/office/bb267350.aspx

• Planning and architecture, deployment, and operations for Office Forms Server 2007 (Downloadable Book)http://technet.microsoft.com/en-us/library/cc197347.aspx

• Office Online - Microsoft Office Forms Server 2007http://office.microsoft.com/en-us/formsserver/FX100490391033.aspx

• Office Developer Center – InfoPath 2007 Resource Centerhttp://msdn.microsoft.com/en-us/office/aa905443.aspx

• MSDN VSTO – InfoPath Developer Reference for Managed Codehttp://msdn.microsoft.com/en-gb/library/aa941030(VS.80).aspx

• InfoPath Team Bloghttp://blogs.msdn.com/infopath

• InfoPath Forms Services 2007 Web Testing Toolkithttp://www.codeplex.com/ipfswebtest

Page 18: Chris Beckett | SharePoint Technology Specialist (206) 965-8257 | chris@sharepointbits.com(206) 965-8257 | chris@sharepointbits.com |

Innovative solutions from a SharePoint Expert. Build your portal right this instant! I can help.

Contact me to discuss your next project : www.sharepointbits.com | [email protected] | (206) 965-8257

Infrastructure and Operations | Web Design and Development | Forms and Workflow | Office/Mobile Integration

Questions and Answers

Tonight’s Topics:

• Forms Services Overview• InfoPath Client vs. Forms Services• Custom Web Services Integration• Advantages of Data Connections• InfoPath Trust Model• Form Publishing Options• Admin-Approved Forms• Invoking Form Services by URL• Passing Parameters• Code-Behind with VSTO• Mobile Forms

Email me to get a copy of

this slide deck