Show or hide rows in a repeating table by using conditional formatting InfoPath 2007

Author: mety Nagm Labels::

use conditional formatting to show or hide a row in a repeating table or repeating section, depending on whether the data in a row matches the value of a drop-down list box control. For example, if your form template has a repeating table that contains rows of products that fall into one of three classifications (A, B, or C), you can use conditional formatting to determine which rows are displayed, based on selections that users make on the form.
Note You can use filters (filter: A set of conditions that is applied to data in order to display a subset of the data.) to enable users to show or hide information in a form. However, because filters aren't supported for browser-compatible form template (browser-compatible form template: A form template that is designed in InfoPath by using a specific compatibility mode. A browser-compatible form template can be browser-enabled when it is published to a server running InfoPath Forms Services.), conditional formatting is a useful alternative to filters in browser-compatible form templates.

Step 1: Add the controls

In order to complete this procedure, your form template must contain a list box and a repeating table. To add these controls, do the following:
  1. On the form template, click where you want to insert a list box and a repeating table.
  2. If the Controls task pane is not visible, click More Controls on the Insert menu, or press ALT+I, C.
  3. Under Insert controls in the Controls task pane, click List Box, and then click Repeating Table.
  4. When you insert a repeating table, you will be prompted for the number of columns. Leave the default value at 3, and then click OK.
  5. Above the list box that you inserted on your form template, type a label that reads Filter by Type:.
  6. Type column labels in the first row of the repeating table, so that the first column reads Product, the second column reads Type, and the third column reads Price.

Step 2: Specify the conditional formatting

After you add your controls to the form template, you can specify the appropriate conditional formatting.
  1. Double-click the list box.
  2. Click the Data tab.
  3. Under List box entries, click Add.
  4. In the Value box, in the Add Choice dialog box, type A, and then click OK.
  5. Repeat steps 3 and 4 to add values for B, C, and D.
  6. In the list of values, select D, and then click Set Default.
  7. Select the repeating table on your form template, and then on the Format menu, click Conditional Formatting.
  8. In the Conditional Formatting dialog box, click Add.
  9. Under If this condition is true, in the first box, select the field that corresponds to the second column of the repeating table.
  10. In the second box, click is not equal to.
  11. In the third box, click Select a field or group.
  12. In the Select a Field or Group dialog box, select the field that corresponds to the list box that you inserted on the form template, and then click OK. Note The condition will dynamically compare the two values.
  13. Under Then apply this formatting in the Conditional Format dialog box, select the Hide this control check box. Note This condition now states that if the content of the second column of a repeating table row is different from what is selected in the list box, then the corresponding rows in the repeating table should be hidden.
  14. To return to the form template, click OK twice.
  15. Double-click the control in the second column of the repeating table.
  16. Click the Data tab.
  17. Type D in the Value box.

Step 3: Preview the form template

After you add conditional formatting to the form template, it is recommended that you test the changes to ensure that they are working properly.
  1. To test your changes, click Preview on the Standard toolbar, or press CTRL+SHIFT+B. Note By default, the selection in the list box is D. You might need to scroll up in the text box to see the other values.
  2. To add a few rows to the repeating table, under the repeating table, click Insert item several times.
  3. For each row in the second column of the repeating table, replace the default value of D with A, B, or C. Note The expressions are case sensitive.
  4. Change the selection in the list box. The rows in the repeating table will appear and disappear as you select different options.



Blog Archive

Powered by Blogger.

I made these pages for me and my friends to help solving the problem we face regarding Computer & internet, if anyone wants me to answer a question or find out about some information please send me email and I will try to reply.*P.S. some of the article I wrote and the other I found on the internet I posted them in sprit of learning and shearing, please forgive me if you found something you don’t want to be in my blog, email me and I will delete them. Thank you for your interest in my pages.امل نجم Amal Nagm

banner 1 banner 2