www.it-ebooks.info Designing Forms for Microsoft Office InfoPath and Forms Services 2007 www.it-ebooks.info www.it-ebooks.info Scott Roberts Hagen Green Designing Forms for Microsoft Office InfoPath and Forms Services 2007 Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris Madrid • Capetown • Sydney • Tokyo • Singapore • Mexico City www.it-ebooks.info Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The .NET logo is either a registered trademark or trademark of Microsoft Corporation in the United States and/or other countries and is used under license from Microsoft. The authors and publisher have taken care in the preparation of this book, but make no expressed or implied war- ranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or con- sequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 corpsales@pearsontechgroup.com For sales outside the United States please contact: International Sales international@pearsoned.com Visit us on the Web: www.awprofessional.com Library of Congress Cataloging-in-Publication Data Roberts, Scott, 1969– Designing forms for Microsoft Office Infopath and forms services 2007 / Scott Roberts, Hagen Green. p. cm. Includes bibliographical references and index. ISBN 0-321-41059-9 (pbk. : alk. paper) 1. Microsoft InfoPath. 2. Business—Forms—Computer programs. I. Green, Hagen. II. Title. HF5371.R63 2007 651'.29028553—dc22 2006036478 Copyright © 2007 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and per- mission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to: Pearson Education, Inc. Rights and Contracts Department 75 Arlington Street, Suite 300 Boston, MA 02116 Fax: (617) 848-7047 ISBN 0-321-41059-9 Text printed in the United States on recycled paper at Courier in Stoughton, Massachusetts. First printing, February 2007 www.it-ebooks.info To my wife, Andrea, and my two sons, Sean and Bradley. It is due to your constant love and support that I was able to complete this project. Thank you for always being there for me no matter what project I undertake. I love you all a million times more than you could ever possibly know. —Scott To Jaime, my love and my life, for putting up with my two jobs and helping me stay strong through the end. And to my parents, Stuart and Christine, for their perseverance in love and for being the best parents anyone could ask for. —Hagen www.it-ebooks.info This page intentionally left blank www.it-ebooks.info Contents at a Glance List of Figures xxi List of Tables xlvii Foreword li Preface lv About the Authors lxv PART I Designing Forms 1 1 Introduction to InfoPath 2007 3 2 Basics of InfoPath Form Design 25 3 Working with Data 85 4 Advanced Controls and Customization 155 5 Adding Logic without Code 215 6 Retrieving Data from External Sources 241 7 Extended Features of Data Connections 297 8 Submitting Form Data 327 9 Saving and Publishing 397 10 Building Reusable Components 431 11 Security and Deployment 455 12 Creating Reports 553 13 Workflow 613 14 Introduction to Forms Services 665 vii www.it-ebooks.info PART II Advanced Form Design 727 15 Writing Code in InfoPath 729 16 Visual Studio Tools for Microsoft Office InfoPath 2007 833 17 Advanced Forms Services 865 18 Hosting InfoPath 965 19 Building Custom Controls Using ActiveX Technologies 1037 20 Add-ins 1073 21 Importers and Exporters 1115 Appendix: Further Reading 1149 Index 1157 Contents at a Glance viii www.it-ebooks.info Contents List of Figures xxi List of Tables xlvii Foreword li Preface lv About the Authors lxv PART I Designing Forms 1 1 Introduction to InfoPath 2007 3 What Is InfoPath? 3 InfoPath 2003 7 InfoPath 2003 Service Pack 1 12 InfoPath 2007 17 What’s Next? 24 2 Basics of InfoPath Form Design 25 Getting Started 25 What Is a Form Template Anyway? 26 Design a Form Template Dialog 27 Creating a New Blank Form Template 30 Designing the Layout of Your Form 34 Using the Layout Task Pane 34 Color Schemes 39 ix www.it-ebooks.info [...]... Introduction to Forms Services 665 Getting Started 665 What Is InfoPath in the Browser? 666 Why Use the Browser? 668 What Is Forms Services? 669 Installing and Configuring Forms Services 671 Installing Forms Services 673 Configuring Forms Services 675 Is Forms Services Installed? 677 Publishing a Form Template to Forms Services 678 Getting Familiar with Browser Forms 682 Creating a New Form 682 Toolbar... Server 2007 634 Workflow with InfoPath E-Mail Forms 643 Designing and Using InfoPath E-Mail Forms 644 Creating Rules for InfoPath E-Mail Forms 648 Storing Received Forms in Outlook Folders 650 Filling Out an InfoPath E-Mail Form 652 Sorting, Grouping, and Filtering Responses 656 Merging and Exporting InfoPath E-Mail Forms 657 Customizing E-Mail Support for a Form Template 660 What’s Next? 663 www.it-ebooks.info... Counter-Signatures 532 Digital Signatures in the XML Data and Schema 533 Information Rights Management 538 Permission on Form Templates 539 Permission on Forms 542 www.it-ebooks.info Contents Permission with Document Libraries 548 What’s Next? 552 12 Creating Reports 553 Getting Started 553 Merging Forms 554 Merging Forms in InfoPath 555 Design Recommendations for Merging Forms 561 Customizing Merge Behavior in Design... Tools for Microsoft Office InfoPath 2007 833 Getting Started 833 What Is VSTO? 834 Bringing InfoPath into Visual Studio 835 Installing VSTO 836 Designing a Form Template with VSTO 836 Start Designing a Form Template 837 The VSTO Design Experience 843 The VSTO Feature Set 853 Missing Features in VSTO 861 Previewing a Form in VSTO 863 What’s Next? 864 www.it-ebooks.info xvii xviii Contents 17 Advanced Forms. .. xvii xviii Contents 17 Advanced Forms Services 865 Getting Started 865 Controls and Browser Optimizations 867 Postback Settings 871 The Update Button 872 Designing Accessible Forms 874 Form Code 875 Executing Form Code in the Browser 876 Circumventing Browser-Enabled Limitations 878 Detecting the Browser or the InfoPath Client 883 Form Code Compatibility with Forms Services 884 SharePoint Integration... Browser Forms 714 Configurations Supported by Forms Services 715 URL-Based Options 716 Mobile Support: Smart Phone and PDA 720 Mobile Compatibility 722 Filling Out a Mobile Form 725 What’s Next? 726 www.it-ebooks.info Contents Part II Advanced Form Design 727 15 Writing Code in InfoPath 729 Getting Started 729 Writing Code Behind a Form 730 Settings Related to Adding Code 732 Adding Code to a Form Template... Template 737 Filling Out and Debugging a Form with Code 738 The InfoPath Object Model 741 Form Events 742 XML Data Events 744 Using XPathNavigator Objects 777 Registering Event Handlers 780 Script and the Custom Task Pane 782 Programming InfoPath in Action! 790 The MOI Consulting Request Form 791 Filling Out the MOI Consulting Request Form 792 Designing the MOI Consulting Request Form 797 What’s Next?... Publishing 888 Managing Form Templates 904 Configuring InfoPath Forms Services 906 Configuring Shared Services and Providers 907 Filling Out a Form on a SharePoint Page 928 Data Connections 929 Data Connections Administration Settings 931 Centrally Managed Connection Library 936 Authentication Considerations 943 E-Mail Data Connections 948 Performance Tips and Best Design Practices 950 Form Template Deployment... Error dialog that appears when opening a form from a path that is not the access path 403 Figure 9.6: Flowchart for determining whether the form template publishes to a SharePoint server or a Forms Services site 404 Figure 9.7: Specifying a server location for publishing to a SharePoint site or Forms Services site 406 Figure 9.8: Choosing whether to publish the form template to a SharePoint document... Next? 395 9 Saving and Publishing 397 Getting Started 397 Saving and Publishing a Form Template with InfoPath 398 Network Locations 400 SharePoint or Forms Services 404 E-Mail 413 Installable Form Templates 417 Common Conveniences 420 Saving Templates as Extracted Source Files 421 Previewing Form Templates 424 With Sample Data 426 With User Roles 427 Domain Simulation 428 Saving Form Data 429 What’s . www.it-ebooks.info Designing Forms for Microsoft Office InfoPath and Forms Services 2007 www.it-ebooks.info www.it-ebooks.info Scott Roberts Hagen Green Designing Forms for Microsoft Office InfoPath and Forms. Is Forms Services? 669 Installing and Configuring Forms Services 671 Installing Forms Services 673 Configuring Forms Services 675 Is Forms Services Installed? 677 Publishing a Form Template to Forms. lxv PART I Designing Forms 1 1 Introduction to InfoPath 2007 3 What Is InfoPath? 3 InfoPath 2003 7 InfoPath 2003 Service Pack 1 12 InfoPath 2007 17 What’s Next? 24 2 Basics of InfoPath Form Design