Best Practices for Developing and Deploying Forms Solutions with Microsoft Office
InfoPath 2007 and InfoPath Forms Services in Microsoft Office SharePoint Server 2007
Christian Stark
Designing InfoPath Forms: The Do’s and Don’ts
Deploying InfoPath Forms: Making the right choice
Adding custom business logic—in case the built-in stuff isn’t enough
Integrating forms into Web pages: Reaching and making it scale
Session Objectives and Agenda
DEMOImporting a Microsoft Office Word FormUsing Template Parts
Designing InfoPath Forms
Form Design Best PracticesWhat to do and what NOT to do
Do Don’tKeep views smallUse view switching for larger formsUse tables to align controlsSet control width to 100% so it scales
with column widthRe-use and adapt existing forms for
online filling experiencePut instructions in the form layoutUse all the validation UI and create
useful error messages
Avoid spaghetti formsAvoid script since it doesn’t work in
browser-based formsAvoid lots of On_Load processingAvoid queries that rarely change
result data in drop downsAvoid the task pane if your form
needs to work in the browser
Build a form design kit with template parts
Use pre-configured data connections via the data connection library
Use pre-defined schemas when building forms
Don’t build super complex forms with 20 or more views
Don’t use InfoPath forms as a Visual Basic replacement
Don’t add lots of custom code to forms
Template Parts and Logic Inspector
Word ImportRe-use existing form layout
Template PartsAllow
Re-use of parts across multiple forms
Multiple developers to work in parallel
Support all form features except codeFormatting and control properties; data connections; rules, validation, conditional formatting, calculations
Create in Design mode and use as a custom controlCentral repository with auto-updates
Logic InspectorInspect and debug the form thru a single, read-only view of all your form logic
Rules, calculations, validation, events
Caveat: Conditional formatting not reported
DEMOBrowser Forms, Design Checker, Deployment Options
Deploying InfoPath Forms
Deploying InfoPath FormsMaking the right choice
Simple deployment for end users Advanced deployment for administrators
Forms with no code (declarative logic only) deployed using InfoPath Designer Publish WizardPublish directly to Microsoft Windows SharePoint Services document library, or create site content type (for use in multiple document libraries)
Central administration and management Activate forms on multiple site collectionsTwo-step process: upload to server, and activate to a site collection
Create multiple document libraries based on a form templateForms containing code or requiring full trust must be deployed by a farm administrator
Use for:Small and more ad-hoc form solutions driven by Information WorkersSmall number of form filling sessionsUn-managed team solutionsVery few to none form upgrades The “quick and dirty” prototype
Use for:Managed department or enterprise-wide solutionsCentralized form solution managementComplex data connectionsLots of form-filling sessionsRobust forms solutions requiring solution upgrades in the future
Design Once, Use Anywhere
Shared featuresControlsBusiness LogicData ConnectionsDigital SignaturesManaged Code Object Model
Design CheckerA pure subset of InfoPath features is available for browser-enabled formsCompatibility errors and warnings can be seen in the Designer or on the server during the publish step
Design forms for rich client, browser and mobile device
Browser-Enabled Forms
Simple topology for scale-outInfoPath Forms Services runs on Web front ends
Session state optimized for bandwidth and scaleIn broadband, view state can be used for high scale
In narrowband, session state can be stored on the backend
Client-side architecture (AJAX) alleviates roundtrips
Improves scalability because of fewer requests
Improves user experience due to minimal interruptions
Design-time guidance on eliminating roundtrips
Per-control settings to tweak roundtrips for best experience of correctness and performance
Performance and scalability
DEMOVSTA and VSTO, Load event,Pre-Populating the Form
Adding Business Logic
InfoPath Business Logic
Most Form Development Does Not Need Code
XSD, Web Service, DatabaseS
chem
a
C#VB .NET
Cod
e
Dec
lara
tive RulesFormulas
Data ValidationData Connections
Conditional Formatting
Visual Studio Integration
1. Visual Studio Tools for Applications (VSTA)Out-of-the-box developmentLowers the bar for forms with managed codeCompatible with Visual Studio Tools for Office
2. Visual Studio Tools for Office (VSTO)Embedded designer for professional developersOne IDE for all your projects: workflow, etc. Integrated toolbox, project wizard, etc.
Write code in your favorite IDE
Resources
Technical Communities, Webcasts, Blogs, Chats & User Groupshttp://www.microsoft.com/communities/default.mspx
Microsoft Developer Network (MSDN) & TechNet http://microsoft.com/msdn http://microsoft.com/technet
Trial Software and Virtual Labshttp://www.microsoft.com/technet/downloads/trials/default.mspx
Microsoft Learning and Certificationhttp://www.microsoft.com/learning/default.mspx
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.