InfoPath Answers

Quick questions and answers about Microsoft Office InfoPath

InfoPath with Silverlight

Silverlight allows you to create client applications that run independently in your browser. Not only that, but Silverlight applications bring the richness of desktop applications to the web.

Because you can integrate Silverlight with SharePoint 2010, you can also combine Silverlight with InfoPath to create rich solutions such as visualizing data from repeating tables in InfoPath forms in a Silverlight chart, or even using a Silverlight application to fill out InfoPath forms. The possibilities are endless, really.

The InfoPath video shown below is a demonstration of how you can dynamically load InfoPath forms into a Silverlight application in SharePoint 2010 to extract data for display in a chart.

Cascading drop-down list boxes in InfoPath repeating table with shrinking SharePoint list

There are many variations on cascading drop-down list boxes in InfoPath, one of which is the scenario where you have a drop-down list box within a repeating table and that drop-down list box is bound to a SharePoint. This means that a drop-down list box will appear with the same SharePoint list items in each row of the repeating table.

The idea of a shrinking SharePoint list is to allow users to select an item only once from a drop-down list box per row in the repeating table, and once selected, an item should not be selectable anymore in any other row in the repeating table.

The InfoPath video below shows you how the completed InfoPath form with shrinking SharePoint list would work when it is hosted in SharePoint 2010.

The solution makes use of several codeless InfoPath techniques (and tricks), most of which are explained and discussed in InfoPath 2010 Cookbook.

The full solution is available in the InfoPath 2010 Cookbook 2 Club.

Cascading InfoPath lists with SharePoint lists

Cascading lists are drop-down list boxes, combo boxes, multiple-selection list boxes, or normal list boxes that can be combined in a way that the items displayed in one list box depend on the item(s) selected in another list box.

While list boxes are commonly used to create cascading lists in InfoPath, you can also use a repeating table to display items that depend on the selected items in one or more list boxes.

The InfoPath video shown below extends recipe 63 of InfoPath 2010 Cookbook 2 by demonstrating how you can use two drop-down list boxes with a repeating table connected to a mixture of normal and linked SharePoint lists to create cascading lists in InfoPath 2010.

The full solution is available in the InfoPath 2010 Cookbook 2 Club.

What is the fastest way to create an InfoPath XML schema?

The fastest way to create an XML schema for an InfoPath form is to let InfoPath 2010 automatically create the XML schema for you as you are placing controls on views in InfoPath and adding fields and groups to the Main data source.

A second option is to use an existing XML file and then let InfoPath automatically create an XML schema that is based on that XML file when you choose the XML or Schema option when you start to design the InfoPath form template.

A third option is to use an existing XSD file and then choose the same aforementioned option to create an InfoPath form template that is based on the XML schema (XSD file).

Where are InfoPath form templates stored in SharePoint 2010?

Where InfoPath 2010 form templates are stored depends on the type of form template you create and the way you publish the form template to SharePoint 2010.

There are several types of InfoPath 2010 form templates you can create for SharePoint 2010. For an overview of the types, see this video: What is an InfoPath browser form

In normal cases, all InfoPath form templates are stored either in a (hidden) folder of a SharePoint form library, a SharePoint list, or a SharePoint workflow depending on the type of form template you have created.

If you publish an InfoPath form template as a content type, you determine in advance where to store the form template. Generally, this would be a SharePoint document library.

And in the case of administrator-approved form templates, a SharePoint form library named Form Templates on the top-level site in a site collection is used to store InfoPath form templates.

How do you make a repeatable field in InfoPath?

You can make a field repeatable or repeating in InfoPath by selecting the Repeating check box on the Add Field or Group dialog box when you add a field to the Main data source of a form.

You can also make a field repeatable or repeating in InfoPath by adding a control that should be bound to a repeating or repeatable field to the view of the form template. A few of such controls include the Multiple-Selection List Box, Plain List, Numbered List, and Bulleted List.

Note that a field can also be made repeatable or repeating by placing it under a repeating group such as that from a Repeating Table or a Repeating Section control.

How to send memo fields in InfoPath

Memo fields in MS Access are great for storing the base64-encoded string from a picture control or the contents of a rich text box control on an InfoPath form.

But while you can directly connect an InfoPath form to an MS Access database, it becomes a bit more difficult when the database tables contain Memo fields. In such cases, you must resort to writing code to submit data to the MS Access database.

Recipe 88 of InfoPath 2010 Cookbook 3 shows you how to write code to work with data in an MS Access database table that has a Memo field. In the following video, you can see what the completed InfoPath form looks like.

Schedule recurring event on SharePoint using InfoPath

Recurring events are events that repeat within a certain period of time. You can use an InfoPath form to schedule such events in a SharePoint calendar.

Recipe 97 of InfoPath 2010 Cookbook 3 contains instructions that show you how to write C# code that can schedule normal events, all-day events, recurring events, and all-day recurring events on SharePoint.

The InfoPath form does not require full-trust to run and can be deployed as a sandboxed solution on SharePoint 2010.

Convert InfoPath form to PDF in SharePoint

While you could use a third-party component to programmatically create a PDF document from InfoPath form data, it is much easier to lay out data from an InfoPath form in a Word document, and then use Word Automation Services in SharePoint 2010 to convert the Word document into PDF.

Recipe 94 of InfoPath 2010 Cookbook 2 shows you how you can create a Word document in SharePoint based on the data stored in an InfoPath form. However, you would still have to write code to schedule a Word Automation Services job so that the Word document can be converted to PDF.

In addition, if you want to convert complex data such as data from repeating tables, bulleted lists, rich text boxes, and picture controls, you would still have to write code to convert such data.

Therefore, recipe 101 of InfoPath 2010 Cookbook 3 shows you how to write C# code to first convert an InfoPath form that contains a repeating table, bulleted list, rich text box, picture control, single-line text box, and multi-line text box into a Word document, and then schedule a Word Automation Services job to convert the automatically generated Word document into a PDF document.

InfoPath 2010 web service example

While there are many uses for web services together with InfoPath forms, one of the most common uses is using a web service to perform CRUD operations on a SQL Server database. The video below shows an example of this.

What recipe 85 of InfoPath 2010 Cookbook 3 also teaches you, is how to write C# code in InfoPath 2010 to retrieve any values that a web service returns after data has been submitted to it.

This includes getting error information back from a web service, but also additional data such as the identifier of the last record that was inserted into a SQL Server database.

Next Page »

InfoPath 2013 Cookbook: 121 Codeless Recipes for Beginners

InfoPath 2013 Cookbook 2: 121 Codeless Recipes for SharePoint 2013

InfoPath 2010 Cookbook: 101 Codeless Recipes for Beginners

InfoPath 2010 Cookbook 2: 101 Codeless Recipes for SharePoint 2010

InfoPath 2010 Cookbook 3: 101 Code Recipes for C# Developers

InfoPath 2010 Cookbook 4: 101 Code Recipes for VB Developers

InfoPath 2010 Cookbook 5: Integrating InfoPath with Excel and Excel Services