To create a table that groups data

You can display data in a grouped fashion inside a table. Grouping organizes and arranges data into relationships, such as Country or Region. You can nest groups to easily identify relationships and see trends. It also helps present summaries, such as totals and counts.

For example, if you supply products, such as monitors, desk lamps, and telephones, you may want to see which country and region is selling the most product. You can create this table, which contains a nested table inside a nested table inside the main table:

  • Country is the table header for the main table.

  • Region is the table header for the first nested table.

  • Product and Profit makes up the table header for the nested table inside the first nested table.

For example, the sample XML file you connect to could have the following syntax:

<form1> 
    <Sales> 
     <SalesData> 
        <country>United States</country> 
        <CountryData> 
             <RegionRow> 
             <region>Western</region> 
        <RegionData> 
        <Item> 
             <product>Monitor</product> 
             <profit>10</profit> 
        </Item> 
        <Item> 
             <product>Desk Lamp</product> 
             <profit>20</profit> 
        </Item> 
        </RegionData> 
             </RegionRow> 
             <RegionRow> 
             <region>Central</region> 
        <RegionData> 
        <Item> 
             <product>Monitor</product> 
             <profit>30</profit> 
        </Item> 
        <Item> 
             <product>Desk Lamp</product> 
             <profit>25</profit> 
        </Item> 
        <Item> 
             <product>Telephone</product> 
             <profit>28</profit> 
        </Item> 
        </RegionData> 
             </RegionRow> 
             <RegionRow> 
        <region>Atlantic</region> 
        <RegionData> 
        <Item> 
             <product>Monitor</product> 
             <profit>31</profit> 
        </Item> 
        <Item> 
             <product>Desk Lamp</product> 
             <profit>17</profit> 
        </Item> 
        <Item> 
             <product>Telephone</product> 
             <profit>22</profit> 
</Item> 
             </RegionData> 
             </RegionRow> 
        </CountryData> 
     </SalesData> 
    </Sales> 
</form1>

Before you perform this task, you must ensure that the following settings are in effect:

To create the main table

  1. Select File > Save As, type a name for the file, and select Adobe Dynamic XML Form (*.pdf). Click OK.

  2. Select Table > Insert Table.

  3. In the Insert Table dialog box, enter the number of columns and rows. For example, enter 2 for the number of columns, 1 for the number of rows.

    You can enter a maximum of 20 columns and 50 rows. You can add more columns and rows after the table is created by using the Insert commands in the Table menu.

  4. (Optional) To include a header row, select Include Header Row In Table.

  5. (Optional) To include a footer row, select Include Footer Row In Table.

  6. Click OK.

  7. Rename the header row. For example, name the first header Country and delete the header text for the second column.

  8. Resize the table.

To create the first nested table

  1. Drag the Table object from the Object Library palette to a cell in the table.

  2. Rename the header row text. For example, name the first header Region and delete the header text for the second column.

To create the last nested table inside the first nested table

  1. Drag the Table object from the Object Library palette to a cell in the table to create another nested table. For example, drag it to the second cell of the body row in the first nested table.

  2. In the Insert Table dialog box, enter the number of columns and rows.

  3. (Optional) To include a header row, select Include Header Row In Table.

  4. (Optional) To include a footer row, select Include Footer Row In Table.

  5. Click OK.

  6. Rename the header row. For example, change the first header to Product and the second header to Profit.

    The form should now look like one.

To show data in the cells

  1. In the Data View palette, drag a node to the cell under the first heading. For example, drag the country node to the cell under the Country heading.

  2. Repeat for the remaining cells.

    For example, drag the region node to the cell under the Region heading. Drag the product node to the cell under the Product heading. Drag the profit node to the cell under the Profit heading.

  3. In the Hierarchy palette, select each Row1 and, in the Binding tab of the Object palette, select Repeat Row For Each Data Item.

  4. Match the table, row, and field names to those in the sample XML file.

    For example, select Table1 in the Hierarchy palette. Then, in the Object palette, click the Binding tab and type $record.Sales in the Data Binding (Open, Save, Submit) box.

    For example, set the default binding as indicated in this table.

    Select in the Hierarchy palette

    Set Data Binding to the corresponding string

    Row1

    SalesData

    country

    country

    Table2

    CountryData

    Row1

    RegionRow[*]

    region

    region

    Table3

    RegionData

    Row1

    Item[*]

    product

    product

    profit

    profit

  5. Select the subform that the main table is in and, in the Subform tab of the Object palette, select Flowed from the Content list.

  6. Format the table. For example, add borders and shading.

  7. View the form in the Preview PDF tab.

// Ethnio survey code removed