What email address or phone number would you like to use to sign in to Docs.com?
If you already have an account that you use with Office or other Microsoft services, enter it here.
Or sign in with:
Signing in allows you to download and like content, which the author will be aware of.
Embed code for: 1_DesigningAFormFromAWebService
Select a size
Microsoft Office InfoPath 2013 Training
The purpose of these labs is to give you a good, hands-on understanding of InfoPath’s basic features.
The sales department at a small trading company wants to create a richly featured order entry form for their sales force to use. The IT department has created a set of custom web services that integrate with the rest of the order processing system, and they want you to create the forms that sales team members will fill out. The form needs to be easy to use, assist the user in catching potential mistakes, and ensure that the form has been filled out correctly. Finally, it needs to integrate well with SharePoint 2010 and 2013. Through the course of these labs, you will create this form.
Exercise 1: Designing a Form Template from a Web Service
In this exercise, you will use the Data Source Setup Wizard to begin creating a new form from an existing XML Schema.
Launch Microsoft InfoPath Designer 2010.
From the Available Form Templates on the New tab of the File menu, select Web Service and click Design Form.
In the Data Connection Wizard, select Receive data and click Next.
Enter the URL to the sample NorthwindSOAPWebService web service, http://<server>/_vti_bin/NorthwindSOAPWebService.asmx and click Next.
Select the GetOrderDataByOrderID operation and click Next.
Click Finish to complete the Data Connection Wizard.
Save the form as NorthwindOrderForm.xsn
Exercise 2: Binding Controls using the Fields Task Pane
In this exercise, you will use the Fields task pane to add controls to the form and bind them to fields in the form’s data source.
Open the NorthwindOrderForm.xsn you created in Exercise 1.
Select all of the default content on the view and delete it.
On the Data ribbon, click Show Fields to display the Fields task pane.
In the Fields task pane, expand dataFields and tns:GetOrderDataByOrderIDResponse and s1:GetOrderDataByOrderIDResult to find the Customers group.
From the Fields task pane, drag the Customers group onto the form.
From the context menu listing the available controls for the Customers group, select Repeating Section.
From the Insert ribbon, add a Single Column Stacked 2 table into the Repeating Section you just added to the form area.
In the new layout table where it reads “Click to add heading”, click and then type “Customer” as the title of the new table.
Expand the tree view under the Customers group in the Fields task pane so you can see the component fields.
Drag the CustomerID, CompanyName, Address, City, Region, PostalCode, and Country fields in the layout table, where it reads “Add label and control”.
Select the text box control for the CustomerID field in the form area and then use the anchor points to resize it so it fits on the same line as its label. Do the same for the CompanyName, Address, and Country controls.
Right-click on the Region control and click Text Box Properties….
In the Text Box Properties dialog box, on the Size tab, make the width of the text box 32 px and click the OK button.
Make the width of the PostalCode text box 80 px.
Resize and arrange the City, Region, and PostalCode controls so they are all on one line.
Delete the labels for the City, Region, and PostalCode controls.
Save the changes to the NorthwindOrderForm.xsn.
Exercise 3: Binding Controls using the Controls Task Pane
In this exercise, you will use the Controls task pane to add controls to the form and bind them to fields in the form’s data source.
On the Home ribbon, click the small Controls Pane button in the Controls section to show the Controls task pane.
Drag a Repeating Section control onto the form inside the Customer Repeating Section and below the layout table.
In the Repeating Section Binding dialog box, expand the Customers tree and select Orders. Then click the OK button.
From the Insert ribbon, insert a Single Column Stacked 2 table into the Repeating Section you just added to the form area.
From the Controls task pane, drag a Text Box control into the heading area of the layout table.
In the Text Box Binding dialog box, expand the Orders tree and select OrderID. Then click the OK button.
Resize the OrderID text box so it fits next to the label.
Right-click in the content area of the layout table and click Split Cells….
In the Split Cells dialog box, pick “3” columns and “1” row, and click OK.
Drag a Date Picker control from the Controls task pane into each of the three new cells in the table. Bind the first Date Picker control to the OrderDate field. Bind the second control to the RequiredDate field. Bind the third control to the ShippedDate field.
Exercise 4: Rebinding Controls to new Data Fields
The data source schema of the NorthwindOrderForm form contains fields to store customer addresses and fields to store shipping addresses. It might make sense to use the same control layout for both kinds of addresses. In this exercise, you will copy the customer address layout you created in Exercise 2: Binding Controls using the Fields Task Pane, and rebind those controls to shipping address fields.
Select the entire Customer layout table and copy it to the clipboard.
Paste the copied table into the Orders Repeating Section, under the Order layout table.
Change the title of the pasted layout table from “Customer” to “Shipping Address”.
Select and delete the CustomerID field and label.
Right-click the CompanyName Text Box control in the Orders Repeating Section and click Change Binding… in the context menu.
In the Text Box Binding dialog box, expand the Orders tree and select ShipName. Then click the OK button.
Using the same operation, rebind the Address, City, Region, PostalCode and Country fields to ShipAddress, ShipCity, ShipRegion, ShipPostalCode and ShipCountry.
Exercise 5: Binding a Repeating Table Control
In this exercise, you will add a Repeating Table control to the form, and use its special binding behavior to bind the columns in that table to fields in the form’s data source.
From the Controls task pane, drag a Repeating Table control into the Orders Repeating Section, under the Shipping Address layout table.
In the Repeating Table Binding dialog box, expand the Customers tree and the Orders tree, and select OrderDetails. Then click the Next button.
Select the ProductID field from the Data binding tree view and click the Add button.
Add the UnitPrice, Quantity and Discount fields, and then click the Finish button.
Drag the ShipVia, and Freight fields from the Fields task pane into the Orders Repeating Section, below the OrderDetails Repeating Table.
Select the Ship Via, and Freight Text Box controls and labels in the Orders Repeating Section and click the Align Right button on the Home ribbon.
Exercise 6: Applying a Theme
In this exercise, you will apply a color scheme to the controls on the form.
On the Page Design ribbon, browse through the available Themes.
Pick one the theme to apply to the form.
Exercise 7: Changing Background Shading and Text Color
With the new theme on the form, the OrderID Text Box does not blend into the title bar of its table. In this exercise, you will change the background shading and text color of the text box so it blends into the title bar again.
Right-click the OrderID Text Box and click Borders and Shading….
On the Borders tab of the Borders and Shading dialog box, click the None preset button to remove the border from the control.
On the Shading tab of the Borders and Shading dialog box, select No Color and click the OK button.
Keep the OrderID Text Box selected.
On the Home ribbon, click the Font Color button and pick the color of text in the rest of the title bar as the font color for the OrderID Text Box.
Exercise 8: Applying Number Formatting
Several of the fields in the form display money amounts and percentages. In this exercise, you will format the controls in the form to display numbers in the right format.
Right-click the Discount Text Box and click Text Box Properties….
On the Data tab of the Text Box Properties dialog box, click the Format… button.
In the Decimal Format dialog box, select Percentage as the format.
Select “2” for the number of decimal places, and click OK.
Click OK in the Text Box Properties dialog box.
Right-click the UnitPrice Text Box and click Text Box Properties….
In the Decimal Format dialog box, select Currency as the format.
Format the Freight Text Box as well.
Test the Form
On the Home ribbon, click the Preview button.
Enter some data into the various controls on the form.
Set the focus on the ProductID control. Click Insert item. InfoPath adds a new row to the OrderDetails table.
Press Ctrl-Enter on the keyboard. InfoPath adds a new row to the OrderDetails table.
Set the focus on the OrderDate control and press Ctrl-Enter on the keyboard. InfoPath adds a new Order section.
Right-click on one of the Order sections. Notice the choices for inserting and removing sections in the context menu.
Select Remove Order from the context menu.
Hover the mouse cursor over a row in the OrderDetails table. Click the grey arrow that displays next to the row. Notice the same kind of context menu available by right-clicking is also available from this user interface.
Add a new row to the OrderDetails table but do not fill in any of the fields.
On the File menu, click Save. Notice that InfoPath warns you that the form contains errors. Click Yes to save the form.
Name the form “TestForm.xml” and save it to your desktop.
On your desktop, right-click on “TestForm.xml” and click Open with and choose Notepad.
This is the XML data that InfoPath saves.
Notice the XML processing instructions that mark this as an InfoPath XML file.
Notice the URL reference to the NorthwindOrders.xsn file.
Notice that none of the form’s user interface is stored anywhere in the file.
Notice that the file is entirely industry-standard XML.ls. Then click the Next button.
Several of the fields in the form display money amounts and percentages. In this exercise, you will format the cont