InfoPath 2010 Cookbook 3 Club

What is the InfoPath 2010 Cookbook 3 Club?

The InfoPath 2010 Cookbook 3 Club is a private site for InfoPath 2010 users who have bought InfoPath 2010 Cookbook 3. The InfoPath 2010 Cookbook 3 Club contains files, articles, and other goodies that will make your InfoPath journey easier, help you solve InfoPath problems, and help you continue learning about InfoPath 2010 programming.

Other InfoPath Cookbook Clubs on BizSupportOnline:

How to access the InfoPath 2010 Cookbook 3 Club

You must own a copy of InfoPath 2010 Cookbook 3, since the book contains the password used to log into the private member's area.

To log into the private area for InfoPath 2010 Cookbook 3:

  1. Read the instructions on this page to look up the username and password.
  2. Click here to log in.

Problems logging in?

If you are using Internet Explorer, try using a different browser such as Chrome or FireFox. The server does not like IE sometimes; or IE does not like it.

Bonus Recipes and Articles for Club Members Only

Calculate business days between two dates excluding holidays stored in a SharePoint calendar

You have a SharePoint 2010 calendar in which holidays are stored as single-day all-day events. You have two date picker controls on an InfoPath form, and want to offer users the ability to calculate the amount of business days (so week days excluding weekends) between the two dates they enter thereby excluding any dates in the holidays SharePoint calendar that fall on and/or between the start and end dates entered by the user.

Learn how you can write C# code to calculate the amount of week days excluding weekends and any non-weekend dates for holidays that are stored in a SharePoint calendar. Holidays that are retrieved from the SharePoint calendar are filtered on the server to retrieve only those days that fall between the start and end date entered on the InfoPath form. This reduces the amount of data that has to be pulled down from SharePoint, since the InfoPath form does not have to retrieve every single date that has been listed in the calendar to be able to determine which dates are holidays.

Create an InfoPath form using a SQL statement

You have 4 tables named User, OfficeApplication, UserApplication, and InfoPathForm, respectively. You want to use the data from the first 3 tables to create an InfoPath form that you can store as a record in the InfoPathForm table. Learn how you can use a SQL statement to create an InfoPath form based on data that is stored in one or more database tables in SQL Server.

Dependent multi-select list boxes using SharePoint lists on an InfoPath browser form

You've got two SharePoint lists (one of which is a linked list) that contain data you would like to display in a cascading manner in multiple-selection list boxes on an InfoPath 2010 browser form. Only those items that are related to the selected item(s) in the first multi-select list box should appear in the second multi-select list box. Learn how to create cascading multi-select list boxes in InfoPath 2010 that make use of SharePoint lists. You can watch a video demonstration of how the solution works.

Display a validation summary on an InfoPath 2010 form

You have an InfoPath form on which you have a couple of controls for which data should be validated. However, you do not want to validate the data while the user is filling out the form, but rather just before the user submits the form. In addition, you want to display all of the errors that need to be fixed in the form together in a separate section at the bottom of the form. Learn how you can mimic the behavior of a validation summary control in ASP.NET on an InfoPath 2010 form.

Display SharePoint group members in InfoPath multiple-selection list box

Learn how you can construct a form template and write code that fills a multiple-selection list box on an InfoPath form with the names of members from a specified SharePoint group. You can watch a video demonstration of how the solution works.

How to store InfoPath rich text in SQL Server

In Chapter 7 of InfoPath 2010 Cookbook 3 you learned several techniques for submitting and retrieving data to/from a SQL Server 2008 R2 database. Now you have a Rich Text Box control on an InfoPath form and want to store the data from this control in a database table in SQL Server.

Import InfoPath XML into SQL Server

In recipe 90 of InfoPath 2010 Cookbook 3 you learned how you can store entire InfoPath forms in SQL Server. Now you have a SQL Server database table named InfoPathForms that has 3 columns: id (int; identity; primary key), formName (varchar 50), and form (xml). Entire InfoPath forms are stored in the third column. You also have a folder named C:\InfoPathForms that contains one or more InfoPath forms you want to import into the InfoPathForms SQL Server database table. In essence, you want to perform a data migration to store existing InfoPath forms in a SQL Server database.

Export InfoPath XML from SQL Server

In recipe 90 of InfoPath 2010 Cookbook 3 you learned how you can store entire InfoPath forms in SQL Server. Now have a folder named C:\InfoPathForms to which you want to export all of the InfoPath forms that are stored in the SQL Server database table to in essence perform a data migration to extract existing InfoPath forms from the SQL Server database and store them as XML files on disk.

Pass repeating table data between InfoPath browser forms

Learn how you can pass data from a repeating table on one InfoPath browser form to a repeating table on another InfoPath browser form in SharePoint. You can watch a video demonstration of how the solution works.

Retrieve autonumber from SQL Server on form submit

You have an InfoPath form which you want to submit to a SharePoint form library, but use SQL Server to automatically generate the name of the InfoPath form when it is submitted to the SharePoint form library. All InfoPath forms must be sequentially numbered in the SharePoint form library. Learn how you can use SQL Server to automatically generate names for InfoPath forms that are submitted to a SharePoint form library.

Troubleshooting

If you get the following error while implementing Recipe 101, please refer to the Errata PDF document for a possible solution:

The file <file name> cannot be opened because there are problems with the contents.				
A document must contain exactly one root element.
Location: Part: /word/numbering.xml, Line: 1, Column: 0
 
InfoPath 2010 Cookbook 3: 101 Code Recipes for C# Developers