InfoPath 2007: Creating a Template Part

Creating a basic Template Part in Microsoft Office InfoPath 2007 is a simple process.  However the rewards that come along afterwards when you have a nice library of template parts is quite nice.  In this post I will give a high level walkthrough of the steps it takes so you can see yourself how easy they are to create and hopefully recognize a few of the benefits of possibly a little work upfront.

Creating a Template Part in InfoPath 2007

Open InfoPath 2007 and select to Design a Form Template

Design a Form Template in InfoPath 2007
You are given a choice to create either a complete form or a template part.  Because the component you are going to create will be used in multiple forms, it makes sense to package it as a template part instead.  In this example, I will create a template part for contact information since it is contained in probably half the forms I make.  Even if some slight items change, using a template part will give me a good starting point.

By selecting template part, you are given a choice to create from a blank template or based on an XML document or schema.  In this case we will select Blank.

InfoPath 2007 Create a Template Part
You design your form by adding the appropriate layout tables and controls to the form.  It is always a good idea to begin this step with a sketched out idea of what your form will look like on paper and the data the form will collect including any dependencies or connections identified.

Similar to a complete template, you can import data from other data sources such as SQL, web services or SharePoint.  In this case, I have a list of provinces contained on a centrally available SharePoint site so I will utilize that.  You never know when Canada could decide to recruit a new province or territory so its important to make it easy for this listing to stay up to date.  OK So maybe in this case I just hate typing so it’s easier for me to grab this information from a central listing somewhere.

 

After all my labels and controls have been added, I am ready to save my template part.

InfoPath 2007 Save Template Part

When you save the template part you will notice it has its own unique file extension (xtp) rather than the xsn you would see if you were saving a complete form.

InfoPath 2007 File Extension xtp for a Template Part

 

Now whenever I want to create a form that contains contact information, I can simply add my template part instead of recreating every single field manually.  Who has time for manual recreation of common elements when there are Stanley Cup Finals or World Cup Soccer games to watch? 

Below the controls listing on the task pane select the link to “Add or Remove Custom Controls…”

InfoPath 2007 Add Custom Controls

Select Template Part from the wizard screen…

InfoPath 2007 Import a Template Part

Browse to the location of your template part.  If you are working on a team, then it would be a good idea to store these in a central location so as to be a library for everyone to use.

InfoPath 2007 Select Template Part for Upload

And Voila you have a new custom control available to you in the task pane.

InfoPath 2007 - Template Parts

InfoPath 2007 Template Part 

 

Just like any other control, click and drag it onto the form to make it appear.  

 

Depending on the complexity of your template part, you can evaluate the benefit of using template parts by comparing the length of time it takes to click and drag versus the length of time it took you to add all the controls and set up your data connection, then multiply it by the number of times you would typically have to add those fields to a form.

UDC Series on InfoPath Blog

Back in the day…you know way back before InfoPath 2007…I used InfoPath 2003 (and SharePoint) to address a lot of my needs as a Product Manager and consultant.  I created a custom CRM system for managing our customer opportunities, billing requests, and project initiation processes.  I created custom templates for project costing, team status reporting, leave requests, purchase requests and virtually anything else I encountered as part of our operations that resembled a repeatable process or information that had to be easily shared or merged for reporting purposes.  InfoPath provided a customizable UI that made many activities easy that would have previously required me to dedicate a team of developers to create…thereby taking them off important product development activities.

However those days as great as they were did have their pain points.  One in particular was related to managing the massive number of data connections many of my form templates were using.  Or more especially, managing multiple templates that linked to a common data source.  This situation only got more complex as I started working on applications and sites that had to move from development environments to production environments.

The InfoPath team blog has always been a favorite of mine due to their ability to write great summaries of the functionality of their product with excellent walkthroughs and examples.  Over the past month, they have continued this tradition by putting together some great articles on data connections and udc files that I have found very helpful. 

Check out all the recent articles on data connections from the InfoPath team blog here.

 

InfoPath 2007 Webcasts

This day just keeps getting better…

As I am waiting for Windows Server 2003 SP1 to finish downloading I decided to catch up a little on my reading and found 3 great new webcasts coming up this month on InfoPath 2007 from the InfoPath Product Team blog.

New Features in Office InfoPath 2007
Time: Tuesday, April 11, 2006 12:00 PM – 1:00 PM (PST)

Presenter: Gray Knowlton, SR. Product Manager – Office
Description: This webcast presents an overview of the new features in Microsoft Office InfoPath 2007 and InfoPath Forms Services. Join us to learn how you can use InfoPath 2007 to automate and extend business processes by utilizing XML and integration standards to connect electronic forms to virtually any application or system.
http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032293903&EventCategory=4&culture=en-US&CountryCode=US

Developing, Deploying, and Hosting Rich Client and Browser Forms for Microsoft Office InfoPath 2007
Time: Tuesday, April 18, 2006 12:00 PM – 1:00 PM (PST)

Presenter: Kalpita Deobhakta, Program Manager – InfoPath
Description: Were you aware that you can design Microsoft Office InfoPath 2007 forms for both the rich client and the browser in a single step? This webcast presents the design-once process for InfoPath 2007, and covers debugging, deployment, and improving the performance and scalability of forms. Find out how to host the InfoPath rich client in other applications, and how to tightly integrate InfoPath 2007 forms into Web pages. We also discuss best practices for using the hosted form control to build powerful but easy-to-use solutions.
http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032293906&EventCategory=4&culture=en-US&CountryCode=US

Developing InfoPath Forms for Office InfoPath 2007
Time: Monday, April 24, 2006 10:00 AM – 11:00 AM (PST)

Presenter: Nima Mirzad, Program Manager – InfoPath
Description: This webcast presents an overview of Microsoft Office InfoPath 2007 programmability features including the managed object model, template parts, and provisions for third-party hosting. We also discuss techniques for using Microsoft Visual Studio 2005 Tools for Applications (VSTA) and Microsoft Visual Studio 2005 Tools for the Microsoft Office System (VSTO) to develop Office InfoPath 2007 forms.
http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032293798&EventCategory=4&culture=en-US&CountryCode=US

From a client application perspective, InfoPath was my superhero in the Office 2003 System. It allowed me to create many awesome business applications that improved the management of my team, our sales process, and most importantly our relationships with our customers. Most importantly however it was also an application that allowed me to be a superhero to some of our clients because I was also able to solve many of their information management problems with InfoPath forms coupled with SharePoint.

2007 is my new favorite number!