+ All Categories
Home > Technology > Infopath das

Infopath das

Date post: 13-Apr-2017
Category:
Upload: hyesayan
View: 653 times
Download: 0 times
Share this document with a friend
82
Microsoft ® Office InfoPath ® 2003 Training Customizing form controls [Your company name] presents:
Transcript
Page 1: Infopath das

Microsoft® Office InfoPath® 2003 Training

Customizing form controls

[Your company name] presents:

Page 2: Infopath das

Customizing form controls

Course contents

• Overview: Techniques for customizing• Lesson 1: Add a button to your form for

switching views• Lesson 2: Display dates and times in a form

(Continued on next slide.)

Page 3: Infopath das

Customizing form controls

Course contents, cont’d.

• Lesson 3: Hide or disable controls, conditional formatting

• Lesson 4: Add up numbers in a table

Each lesson includes a list of suggested tasks and a set of test questions.

Page 4: Infopath das

Customizing form controls

Controls are an essential part of any InfoPath form. Discover four great techniques for working with them effectively.

Overview: Techniques for customizing

For example, you can create a button that lets people switch easily between form views.You can also display dates and times the way you want using text boxes and date pickers.

Page 5: Infopath das

Customizing form controls

Course goals

• Add a button that automatically switches between different views of the same form.

• Display dates and times in a form.• Hide or disable a control.• Add up numbers in a table.

Page 6: Infopath das

Lesson 1

Add a button to your form for switching views

Page 7: Infopath das

Customizing form controls

Add a button for switching views

In InfoPath, you can offer different ways to look at the data in your form by creating different views.

You might create a special view that's optimized for printing.

You might also create a high-level summary view to remove some of the detail in a complex form.

Adding a button provides easy switching between views.

Page 8: Infopath das

Customizing form controls

A refresher on views

A view is an alternative way to look at or present data in a form. InfoPath forms can have more than one view.

Views offer different perspectives of the data in a form.

Page 9: Infopath das

Customizing form controls

A refresher on views

You might use views to:• Simplify a long, complex form

by splitting it up into different views.

• Show different versions of a form to different people based on their role in your organization.

• Create a print-friendly view of your form.

Views offer different perspectives of the data in a form.

Page 10: Infopath das

Customizing form controls

A refresher on views

You can freely copy the controls you need from your main view into other views in the form because all views share the same data source.

Views offer different perspectives of the data in a form.

Page 11: Infopath das

Customizing form controls

Views: The user experience

If you design your form with multiple views, people filling out the form can switch from one view to another by clicking commands on the View menu.

You can supply buttons as another way to switch views..

Page 12: Infopath das

Customizing form controls

Views: The user experience

To help form users who might miss the menu commands, add buttons to your form for switching views.

You can supply buttons as another way to switch views.

Page 13: Infopath das

Customizing form controls

According to the rules

Once you insert the button, how do you make it switch views when someone clicks it? The easiest way is to use a rule.

Rules automate certain tasks in a form in response to events or actions initiated by the person filling out the form.A rule makes the

button switch views.

Page 14: Infopath das

Customizing form controls

According to the rules

In this example, the picture at left shows that the form designer has created a rule that switches from the default form view, which contains a lot of detail, to a high-level summary view.

A rule makes the button switch views.

Page 15: Infopath das

Customizing form controls

According to the rules

Double-click the button to open the Button Properties dialog box.

From within this dialog box, you can access the Rule dialog box, which is where you set up the rule for switching the view.

A rule makes the button switch views.

To create a rule for the button:

Page 16: Infopath das

Customizing form controls

According to the rules

Use the Rule dialog box to associate rules with most controls in InfoPath, such as text boxes and check boxes.

A rule makes the button switch views.

In this case, we want to associate a rule with a button so that the view changes when a button is clicked.

Page 17: Infopath das

Customizing form controls

Suggestions for practice

1. Look at a form that has two views, and see InfoPath's default behavior for switching between them.

2. Insert a button in each view.3. Create a rule that switches views.4. Test the user experience by clicking the buttons in

a preview.Online practice (requires InfoPath 2003 Service Pack I)

Page 18: Infopath das

Customizing form controls

Test 1, question 1

In InfoPath, a _____ is an alternative way to present data in a form. (Pick one answer.)

1. Subform.2. Transform.3. View.4. Preview.

Page 19: Infopath das

Customizing form controls

Test 1, question 1: Answer

View.

When a user switches to a different view, the form's data doesn't change; only the presentation of the form and the amount of data displayed change.

Page 20: Infopath das

Customizing form controls

Test 1, question 2

How can people switch between views when filling out a form? (Pick one answer.)

1. By clicking commands on a View menu or by clicking a custom button on the form.

2. By clicking commands on a View menu or by selecting options in a Views task pane.

Page 21: Infopath das

Customizing form controls

Test 1, question 2: Answer

By clicking commands on a View menu or by clicking a custom button on the form.

If your form has multiple views, InfoPath automatically adds view-switching commands to the View menu for the user. You can also use a custom button and add a rule to it for switching views.

Page 22: Infopath das

Customizing form controls

Test 1, question 3

In InfoPath, rules are used to: (Pick one answer.)

1. Prevent users from accessing restricted data in a form.

2. Automate certain tasks in a form. 3. Assign different roles to different types of

users.

Page 23: Infopath das

Customizing form controls

Test 1, question 3: Answer

Automate certain tasks in a form.

As you learned in this lesson, you can use rules to automatically switch views in response to a button click.

Page 24: Infopath das

Customizing form controls

Test 1, question 4

It's okay to copy controls between views when you're designing a form. (Pick one answer.)1. True. 2. False.

Page 25: Infopath das

Customizing form controls

Test 1, question 4: Answer

True.

Page 26: Infopath das

Lesson 2

Display dates and times in a form

Page 27: Infopath das

Customizing form controls

Display dates and times in a form

Many forms contain dates. For example, you may have a form that shows the current date by default when people open it. Or, you may have one that includes a field where people can easily enter dates in a uniform way.

InfoPath offers you different ways to display dates in a form and to collect dates from people.

There are many ways to display dates in a form.

Page 28: Infopath das

Customizing form controls

Display dates and times in a form

In this lesson, you will:

There are many ways to display dates in a form.

• Work with the today and now functions, which you, as the form designer, can use to show today's date and time in your form.

• Work with the date picker, a control that lets users manually enter dates.

• Learn how to better control the way dates display in your form.

Page 29: Infopath das

Customizing form controls

Pick a date, any date

The date picker is a control that lets people quickly enter dates in a form by clicking in a small pop-up calendar.

It looks a lot like a text box, with a small calendar icon on its right side.

The date picker When people click this icon, a pop-up calendar appears in their form, allowing them to enter dates.

Page 30: Infopath das

Customizing form controls

Pick a date, any date

The date picker

• Double-click the control and change its properties.

• You can specify a default date or change the way the date looks in the form.

The date picker can be customized:

Page 31: Infopath das

Customizing form controls

Display today's date or time

The date picker is a great way to let users enter dates of their choice, such as start and end dates for a particular project.

The today and now functions

Page 32: Infopath das

Customizing form controls

Display today's date or time

But what if you want today's date to display automatically whenever people create a form?

The today and now functions

In this case, you can use a special function called the today function to add the current date to your form.

Page 33: Infopath das

Customizing form controls

Display today's date or time

The now function is similar to the today function.Users see the current time displayed in addition to today's date.

The today and now functions

Page 34: Infopath das

Customizing form controls

What if I don’t like how the date looks?

What if the date inside a text box or date picker appears in the form as 10/18/08, but you'd rather it be October 18, 2008, or 18-Oct-2008, or something else entirely?

Changing the display format

All you need to do is change the display format for the date or time.

Page 35: Infopath das

Customizing form controls

What if I don’t like how the date looks?

To do this, your control must be one of the following three data types:• Date (date) • Time (time) • Date and Time (dateTime)

Changing the display format

Page 36: Infopath das

Customizing form controls

What if I don’t like how the date looks?

If your control uses an appropriate data type, you can specify exactly how you want dates and times to look.1. To change the way the date

displays, double-click the date picker control, and then click the Format button.

2. Pick a display format in the Date Format dialog box.

Changing the display format

Page 37: Infopath das

Customizing form controls

Suggestions for practice

1. Insert a date picker.2. Change the way the date displays.3. Configure a text box to display the current date.4. Configure a text box to display the current date

and time.5. Fine-tune the text box (extra credit).Online practice (requires InfoPath 2003 Service Pack 1)

Page 38: Infopath das

Customizing form controls

Test 2, question 1

What's the difference between the today and now functions? (Pick one answer.)

1. The now function shows the current date and time; the today function shows only the current date.

2. The today function shows the current date and time; the now function shows only the current date.

Page 39: Infopath das

Customizing form controls

Test 2, question 1: Answer

The now function shows the current date and time; the today function shows only the current date.

Page 40: Infopath das

Customizing form controls

Test 2, question 2

If you want the date inside a control to look like August 18, 2008, instead of 8/18/08, what would you do? (Pick one answer.)1. Type over the date in the control. 2. Change the data type. 3. Change the display format for the control.

Page 41: Infopath das

Customizing form controls

Test 2, question 2: Answer

Change the display format for the control.

If the data type for your control is Date (date), Time (time), or Date and Time (dateTime), you can change the display format in the Properties dialog box for the control.

Page 42: Infopath das

Customizing form controls

Test 2, question 3

How can you prevent people from typing over a preset date in a control? (Pick one answer.)1. You can't; people can opt to change these

dates if they want to. 2. Use data validation to display a warning

message. 3. Open the properties dialog box, and make the

control read-only.

Page 43: Infopath das

Customizing form controls

Test 2, question 3: Answer

Open the properties dialog box, and make the control read-only.As you learned in the practice session, if you make a control read-only, users can see the date but they won't be able to change it.

Page 44: Infopath das

Lesson 3

Hide or disable controls with conditional

formatting

Page 45: Infopath das

Customizing form controls

Hide or disable controls

You may know that you can use conditional formatting to draw attention to controls in a form through the use of color and character formatting. But did you know that you can also hide or disable a control — or even a whole section of a form — based on the value in another control?

Hide a control with conditional formatting.

Page 46: Infopath das

Customizing form controls

Conditional formatting refresher

Conditional formatting is often used to highlight or call attention to specific, important, or sensitive information in a form.In InfoPath, you typically use conditional formatting to change the appearance of a control based on values users enter into your form.

Page 47: Infopath das

Customizing form controls

Conditional formatting refresher

When you work with conditional formatting, you set conditions for formatting controls:• If the conditions are met, then

InfoPath changes the appearance of the control.

• If they aren't met, no changes take place.

Page 48: Infopath das

Customizing form controls

Conditional formatting refresher

Take a look at the example in the picture. In the second row, notice how the amount spent exceeds the amount budgeted? The form designer has used conditional formatting to draw attention to this fact.

Page 49: Infopath das

Customizing form controls

Conditional formatting refresher

In this case, you can describe the condition as follows:“If the value in the Amount Spent box exceeds the value in the Amount Budgeted box, then apply red shading to the Amount Spent box.”

Page 50: Infopath das

Customizing form controls

Conditional formatting refresher

To create conditions, use the Conditional Format dialog box, which is accessible from the Format menu in design mode, or through the properties dialog boxes for text boxes and other controls.

Page 51: Infopath das

Customizing form controls

Use a check box to show or hide a section

One of the best ways to use conditional formatting is to show or hide a control based on the value entered or selected in another control.A typical way to do this is to design your form with a check box above a section so that selecting the check box hides or shows the section.

Page 52: Infopath das

Customizing form controls

Use a check box to show or hide a section

For example, in an expense report, you might use conditional formatting to show a manager-approval section to people when their expenses total more than $1,000. If expenses are less than that, the section remains hidden in the form.

Page 53: Infopath das

Customizing form controls

Use a check box to show or hide a section

Or, imagine a form in which you want people to be able to add an alternative shipping address.In this case, you might include an Add another address check box above an Alternative address section in your form.

Page 54: Infopath das

Customizing form controls

Use a check box to show or hide a section

1. When people select the Add another address check box…

2. …the Alternative address section appears in the form.

See the illustration at left. With conditional formatting, you can choose to hide an alternative address section by default.

Page 55: Infopath das

Customizing form controls

Make text boxes read-only

Along with its other uses, conditional formatting can make one or more controls read-only. A control can be read but not changed after a particular condition is met — for example, after a check box is selected.

Read-only text boxes

Page 56: Infopath das

Customizing form controls

Make text boxes read-only

Conditional formatting can also be used to make each text box in the section read-only if a check box is cleared.

1. When the I accept the terms and conditions check box is not selected...

2. …people won't be able to fill out the registration boxes.

Read-only text boxesSee the illustration at left.

Page 57: Infopath das

Customizing form controls

Make text boxes read-only

You can also disable buttons and other controls based on conditions in the form. When a control is disabled, it appears dimmed in the form.

Read-only text boxes

Page 58: Infopath das

Customizing form controls

Suggestions for practice

1. Use conditional formatting to show or hide a section.

2. Test the behavior.3. Remove the conditional formatting from the

section.4. Make text boxes inside the section read-only.Online practice (requires InfoPath 2003 Service Pack 1)

Page 59: Infopath das

Customizing form controls

Test 3, question 1

What's the best way to make a section disappear when a check box is selected? (Pick one answer.)1. Use conditional formatting. 2. Use a rule. 3. Use data validation.

Page 60: Infopath das

Customizing form controls

Test 3, question 1: Answer

Use conditional formatting.

You can use conditional formatting to create an expandable and collapsible section or to hide a control based on a value selected elsewhere in the form.

Page 61: Infopath das

Customizing form controls

Test 3, question 2

How can you access the Conditional Format dialog box? (Pick one answer.)1. By using either the Format menu or the Edit

menu. 2. By using the Format menu only. 3. By using either the Format menu or by

accessing a control's properties.

Page 62: Infopath das

Customizing form controls

Test 3, question 2: Answer

By using either the Format menu or by accessing a control's properties.

To use the menu command, select the control first; to use a control's properties dialog box, double-click the control. Then, look for the Conditional Formatting button on the Display tab.

Page 63: Infopath das

Customizing form controls

Test 3, question 3

When you use conditional formatting to make a text box read-only, how does its appearance change? (Pick one answer.)1. The text box's appearance doesn't change in any

way. 2. The text box appears dimmed. 3. The text box turns red.

Page 64: Infopath das

Customizing form controls

Test 3, question 3: Answer

The text box's appearance doesn't change in any way.

The appearance of the text box doesn't change; users just can't type in it.

Page 65: Infopath das

Lesson 4

Add up numbers in a table

Page 66: Infopath das

Customizing form controls

Add up numbers in a table

You don't have to be a math whiz to work with numbers in InfoPath. Learn how easy it is to use the sum function to add up numbers in a repeating table. A running total in

a repeating table

Page 67: Infopath das

Customizing form controls

Anatomy of a repeating table

When you want people to be able to add multiple rows to a table, you can use a repeating table in your form.The repeating table in

design mode Repeating tables are great for collecting line items or numerical data.

Page 68: Infopath das

Customizing form controls

Anatomy of a repeating table

The repeating table in design mode

1. Header row2. Data row3. Footer row

There are three parts to a repeating table, as shown in the picture:

Page 69: Infopath das

Customizing form controls

Anatomy of a repeating table

The header row: When you insert a repeating table in a new blank form, the header row appears by default. The repeating table in

design mode

Page 70: Infopath das

Customizing form controls

Anatomy of a repeating table

The data row: The data row is the meat of the table, the row that can "repeat" in the form as many times as necessary.The repeating table in

design mode

Page 71: Infopath das

Customizing form controls

Anatomy of a repeating table

The footer row: You can use the footer row to add boxes that total up the values in a column.

The repeating table in design mode

Page 72: Infopath das

Customizing form controls

Anatomy of a repeating table

1. The shortcut menu button appears whenever form users move their mouse over a row. Users click it to see a shortcut menu of commands for inserting or removing a row.The repeating table in

the user’s view 2. The user can also insert a new row by clicking Insert item. As the form designer, you can customize or turn off this text.

Page 73: Infopath das

Customizing form controls

The sum function

If you use a repeating table to collect numerical data from your users, you can use the sum function to add up numbers in the table.

The sum function totals the column’s values in a repeating table.

Page 74: Infopath das

Customizing form controls

The sum function

Important: When working with repeating tables, you should add the Total box to the footer row, not the data row. That's because form users can add multiple instances of the data row, and you wouldn't want the Total box to show up multiple times in the user's form.The sum function

totals the column’s values in a repeating table.

Page 75: Infopath das

Customizing form controls

Suggestions for practice

1. Add a footer row to a repeating table.2. Add a Total box.3. Do the math.4. Test the user experience.5. Format the footer row.6. Make the Total box read-only.

Online practice (requires InfoPath 2003 Service Pack 1)

Page 76: Infopath das

Customizing form controls

Test 4, question 1

The person filling out the form can add extra footer rows to a repeating table. (Pick one answer.)1. False. 2. True.

Page 77: Infopath das

Customizing form controls

Test 4, question 1: Answer

False.

People completing a form can only add additional data rows — that's the whole point of a repeating table.

Page 78: Infopath das

Customizing form controls

Test 4, question 2

If you wanted to total numbers in a repeating table, which of the following formulas would yield a correct result? (Pick one answer.)1. sum(field1) 2. =sum(field1) 3. sum(field1:field8)

Page 79: Infopath das

Customizing form controls

Test 4, question 2: Answer

sum(field1)

This formula would add up all instances of field1 in a form.

Page 80: Infopath das

Customizing form controls

Test 4, question 3

In design mode, which row doesn't appear by default after you insert a repeating table? (Pick one answer.)1. The data row. 2. The footer row. 3. The header row.

Page 81: Infopath das

Customizing form controls

Test 4, question 3: Answer

The footer row.

If you want a footer row for your table, you have to select a check box in the Repeating Table Properties dialog box.

Page 82: Infopath das

Customizing form controls

Quick Reference Card

For a summary of the tasks covered in this course, view the Quick Reference Card.


Recommended