Introduction to views InfoPath 2007
Author: mety Labels:: Introduction to views InfoPath 2007By designing different views of your form template, you can offer users different ways to look at data. For example, you might create a special view that is optimized for printing, or you might create a high-level summary view to eliminate some of the details in a complex form template. Scenarios for using viewsThere are many reasons to create multiple views for a form template. For example, with multiple views you can:
No matter how many views you have in your form template, they all share the same data source (data source: The collection of fields and groups that define and store the data for an InfoPath form. Controls in the form are bound to the fields and groups in the data source.). To illustrate this point, imagine that your form template has two views. If you have an e-mail address text box in the default view, you can copy it into the second view. When users type their e-mail address in one view, that e-mail address automatically appears in the other view. You can copy the controls between views without causing binding (bind: To connect a control to a field or group in the data source so that data entered into the control is saved. When a control is unbound, it is not connected to a field or group, and so data entered into the control will not be saved.) problems. For example, if you copy the e-mail address text box from the first view, and then paste it into the second view, you won't see the Control stores duplicate data binding message that would display if you were to copy and paste the text box within the same view. Design considerationsAs you design a new view, you will typically do the following tasks:
The Views task paneYou use the Views task pane to add or delete views, or to switch between views.From the task pane, you can click the View Properties button to open the View Properties dialog box, where you can customize settings and behavior for the selected view. You can also use the Views task pane to create and associate a print view with an existing view. After creating a print view, you design it to reflect the way that you want the form template to appear when printed. This typically involves copying and pasting controls from the first view into the print view. You can also use the View Properties dialog box to specify custom printing options for the print view, such as headers, footers, and page margins. The user experienceBy default, users can switch between views by clicking commands on the View menu. The names of the menu commands match the names that you chose for the views when you designed them. The active view is indicated by a check mark next to the menu item.To make the availability of multiple views more obvious to users who might miss the menu commands, you can add buttons to your form template for switching between views. After you insert the button on your form template, you can associate a rule with the button so that it switches views when a user clicks it. For example, in an insurance claim form template, you might create a Show Summary button that opens a high-level view of the claim data when clicked. In the summary view, users can click a Show Details button to return to the more detailed view. You may occasionally want to hide the default menu commands for switching views from users. This is useful in scenarios where you don't want users to be able to access views other than the one that you intend for them to fill out. For example, a form template that is used to collect feedback about job applicants might have three distinct user roles (user role: A predefined category that can be assigned to form users based on job title or some other criterion. Roles are typically used to present customized versions of a form to different types of users.) associated with it — one for recruiters, one for interviewers, and one for hiring managers. For each user role, you can design a slightly different view of the form template. To help prevent interviewers from switching to the recruiter or hiring manager views, when you design the recruiter and hiring manager views, you can open the View Properties dialog box and clear the Show on the View menu when filling out the form check box. Tip If you plan to offer users multiple views to choose from, you can consider displaying those choices as entries in a drop-down list box on the form. Users can then click the view that they want in the list. Using rules to switch viewsViews are often designed to work with rules. Rules allow you to automate certain tasks in a form template in response to events or actions initiated by the person filling out the form. For example, you can insert a button on your form template, and then create a rule that switches views when that button is clicked. In addition, you can use a rule to switch views when a form is opened. This can be useful when you want to present different views to different categories of users based on user role assignments.You can use the Rule dialog box to associate rules with most controls in InfoPath, including buttons. In the following example, the form designer has created a rule in the Rule dialog box that switches to the summary view. This rule runs whenever users click a button in the form. Tip Using a rule to switch views when the user clicks a button is also useful when you want your users to navigate sequentially from one view to another. In this case, you would add two buttons to each view and use labels such as < Back and Next >. |