Adding Tables to a Form

Objectives

After completing this lesson, you will be able to:
  • Integrate tables in the form layout
  • Set conditional breaks for tables

Table Management

Play the video to learn more about static and dynamic tables.

Even though you can manually create a table by using the Object and Hierarchy palettes, you can also drag a table from the Data View to the Layout Editor tab page (the table is typically a subnode from the Data View). You can then remove the fields that you do not want to include in the form table.

Creating a Dynamic Table – Preliminary Steps

You can create an accessible table by dragging an internal table from the Data View to the layout.

You can create a table as follows:

  1. Choose the Data View palette menu.
  2. Choose Options.
  3. In the Data View Options dialog box, select the Allow Tables To Be Generated checkbox.

If the Allow Tables To Be Generated checkbox is deselected, Adobe LiveCycle Designer creates nested, flowed, or positioned subforms. In general, you should generate dynamic tables, unless you want to create multi-line tables or tables that extend horizontally instead of vertically.

Drag the internal table from the Data View to the layout. Include the internal table in a page (detail view). Unless you know in advance that the maximum table length will not exceed one page, include it in a Flowed type subform, which allows page breaks.

Once you identify the columns for the table, you can determine cell widths and heights by dragging the cell borders.

You can add or remove cells as follows:

  1. Position the cursor where you want to add or remove cells.
  2. Use the Table toolbar.
  3. Alternately, use the Table menu, which has more functions.

The Table Toolbar

You can add another row, such as a header row, as follows:

  1. Position the cursor on one row in the Hierarchy palette or on a cell in the Layout.
  2. Choose TableInsertRow Above.

After determining the number of rows and cells, you need to make some adjustments.

Manual Adjustments After Inserting the Table

You can make the following manual adjustments after you insert a table:

  • Set margins, widths, and heights.
  • Set the border, if required.
  • Override values, if desired.
  • Change the appearance of the table.

Possible settings for the table are as follows:

  • In the Object palette, on the Binding tab, you can decide whether or not an empty table should be printed, as follows:

    • Select the Min Count checkbox and set it to 1.

      This value ensures that the table header is printed even if the table contains no data.

    • Select the Min Count checkbox and set it to 0.

      This ensures the table is not printed unless it contains at least one row of data.

  • In the Object palette, on the Table tab, you can prevent page breaks (if the table is a subform) by selecting or deselecting the Allow Page Breaks within Content checkbox.

  • In the table's Border palette, you can choose for the table to have an outer border only.
  • You can apply shading (for example, alternating stripes) to your table as follows:
    1. In the Hierarchy palette, select the table.
    2. In the Object palette, on the Row Shading tab, select the Apply Alternating Row Shading checkbox.

Possible settings for the header row are as follows:

  • Give the header a name, so that it can easily be identified when used for conditional breaks or scripting.
  • In the Object palette, on the Pagination tab, determine whether the header should be used on the first page or on subsequent pages.

Possible settings for header fields are as follows:

  • In a typical scenario, you would use an internal table with the form data provider and, in turn, the ABAP dictionary reference in your form. In that case, the cell values (column headers) are taken from the data element texts. If you would like to change them, or if you do not have a dictionary reference in the first place, you can enter your own values.
  • If you need dynamic column headers, you can change the original static texts from the header row to text fields.
  • You can set margins, column widths, and row heights in the Layout palette. You can change the widths and heights in the layout editor by selecting a cell border and dropping it at the desired position. If you change the width of a header cell, the width of the corresponding data cell is changed automatically, and vice versa.

Possible settings for the DATA (Body) row are as follows:

  • In the Object palette, on the Binding tab, you can set the minimum number of body rows that you want to print. If enough data is not available at runtime, this results in empty rows. Likewise, you can set the maximum number of rows to be rendered. If you set the minimum and maximum to the same size, you create a static table.
  • You can determine conditional breaks.

Possible settings for the DATA fields are as follows:

  • Depending on your Library palette settings, you might get appearances like Sunken box for your data fields, which you might want to avoid for print forms.
  • The settings for borders, margins, widths, and heights are the same as for the header fields.

Conditional Breaks

You may want to have additional page breaks or intermittent headers if a condition is met. An example of such a data-driven break would be if, within a table of flight bookings, the next dataset has a different airline, the system should insert an empty separator row.

Setting Conditional Breaks

You can set conditional breaks in the Object palette, on the Pagination tab, in the DATA row (body row). When you choose the plus sign, you add one condition. For every condition, you can choose between FormCalc and JavaScript as the scripting languages.

You can enter any logical expression that results in true or false. A typical scenario would be to compare a particular cell value in one row with the cell in the previous or next row. For such a case, Adobe LiveCycle Designer can suggest some coding for all table fields, which you can then adapt to your needs.

Hint

Generally, conditional breaks based on row comparison only make sense if you have sorted the table earlier.

The places that you can jump to if the system meets the condition include all those places that are available for normal subforms. Furthermore, you have the option to not insert a break, but just an additional header. If you want to have a header when the condition is met, select it as the leader.

Hint

The header (heading) that you set for a conditional break is not processed for a regular page break that occurs when data does not fit on one page, unless you explicitly say so. Conversely, if you select Include Header Row in Subsequent Pages on the Pagination tab, the header is only shown during a normal page break and not by a data-driven page break.

In other words, you might have several headers, some for regular page breaks and some for data-driven breaks.

How to Add Tables to a Form

Business Example

A travel agency wants to use SAP Forms service by Adobe to print invoices for its customers' flight bookings. The list of bookings needs to be included in the invoices.

Follow the simulation to learn how to integrate tables into a form and use them.

Log in to track your progress & complete quizzes