Section 13.6.  Organize the viewed data

Prev don't be afraid of buying books Next

13.6. Organize the viewed data

Once you have displayed repeating data in a view, FrontPage will allow you to massage that data in various ways, including inserting new columns, sorting and grouping, filtering, and conditional formatting.

13.6.1 Inserting columns

Our generated expense table automatically cuts the table off at five columns, but more columns can be added manually to reflect the rest of the child elements. To do this:

1. Position the cursor after the last column header, namely perDiem.

2. On the Table menu, point to Insert, then click Rows or Columns.

3. This brings up the Insert Rows or Columns dialog, as shown in Figure 13-4.

Figure 13-4. The Insert Rows or Columns dialog




4. Click Columns, then OK. This will place a column after the perDiem column.

5. To specify a column header, type Lodging into the first row of the new column.

6. To populate the column, drag the lodging element into the second row of the new column. This will automatically populate all the rows of the table with the lodging data.

After you have added the rest of the columns, and revised the column headers, you are left with a table that looks like Figure 13-5.

Figure 13-5. The revised table




13.6.2 Sorting and grouping

Suppose you want to sort our expense items by date. To do this:

1. Position the cursor anywhere in the table.

2. On the Data menu, click Sort and Group. This displays the Sort and Group dialog shown in Figure 13-6.

Figure 13-6. The Sort and Group dialog




3. Select date from the list on the left, and click Add. This will add date to the list of columns to sort on.

4. Click OK and verify that the rows in the table are now sorted by date.

In addition to sorting, rows can be grouped together by the column(s) on which they are sorted. This can be accomplished by checking the Show group header box on the Sort and Group dialog. This will result in a table that looks like Figure 13-7.

Figure 13-7. The sorted and grouped table




13.6.3 Filtering

It is also possible to filter the rows, based on conditions you specify. For example, suppose you want to show only the expenses where there is a lodging charge greater than $150. To do this:

1. Position the cursor anywhere in the table.

2. On the Data menu, click Filter. This displays the Filter Criteria dialog shown in Figure 13-8.

Figure 13-8. The Filter Criteria dialog




3. Click the row that says Click here to add a new clause.

4. Select the field name lodging (Number), comparison (Greater Than) and the value (150) and click OK.

This will limit the view to only those rows that have a value greater than 150 in the lodging element.

You can enter multiple criteria and join them using AND or OR operators. You can also specify criteria based on variables, such as the current date, and whether it is the first row in the table.

By clicking Advanced on the Filter Criteria dialog, you can also manually specify an XPath predicate that will be used to select the appropriate rows. For example, you could enter [number(ddw1:lodging) > '150'] to specify the same criteria as above. The ddw1 prefix was assigned by FrontPage to the expense report schema's target namespace. The number function instructs the processor to treat lodging like a number rather than a string. Using XPath provides more flexibility, allowing you to utilize functions such as count and max.

Amazon


XML in Office 2003. Information Sharing with Desktop XML
XML in Office 2003: Information Sharing with Desktop XML
ISBN: 013142193X
EAN: 2147483647
Year: 2003
Pages: 176

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net