In most reports each record is evenly spaced down the page. In some databases, however, the amount of data in each record may vary dramatically. For example, a database of catalog items may contain a description field whose contents vary dramatically. Some descriptions may be only a few words long, while others are several hundred words long. When a database like this is printed with a fixed height per record there will be large gaps between some of the records. For example, consider this form designed for printing a catalog of books.

Since this form is designed to print the longest possible description, it will leave gaps when printing shorter book descriptions.

To print this type of database without leaving these large gaps between the records the report must be printed with variable height records. Contrary to what you might think at first, creating a report with variable height records does not involve using a special report tile. Instead, you design the report for the minimum possible size (in this case a one line description) and tell Panorama which objects may need to expand to accommodate extra data. As the report prints, Panorama will automatically expand these objects, and also adjust any other objects that may need to make room.

Here is a revised version of our book catalog form that is designed to print the minimum possible amount — a one line description.

Of course when this report is printed it isn’t what we want at all - only the first line of each description is printed. (On the other hand, we have gotten rid of the gaps between the records!)

To fix this problem we need to select the Description object and make it Expandable.

The Description object is the only object that needs to be made expandable. You don’t need to make anything else expandable, including the Data tile. (On the other hand, it doesn’t hurt anything to make the Data tile expandable. Since the Data tile doesn’t contain any data itself it cannot expand on its own. When a data cell (or other variable height object) expands, the tile it is placed on expands automatically. Although you can make any type of object variable height, it only makes sense for objects that can contain variable height data: Text Editor, Text Display, and Image Display.)

Now that the Description object is expandable we get a very nice printed report that even Goldilock’s could love — each record is not too long, not too short, but just right.

It’s possible to place two or more expandable objects side-by-side in a form. This report contains two expandable objects: an Image Display Object and a Text Display Object.

When you place expandable objects side-by-side, it’s important to make sure that the bottom edges of the expandable objects are perfectly aligned. You can make sure they are aligned properly with the Align Objects command (see Aligning Objects). When the objects are perfectly aligned Panorama will adjust the form for the tallest object. In this example either the image or the text may be larger — the form will be adjusted for whichever is taller.

Any graphic element below an expandable object will shift downward as the expandable object expands. Any graphic element surrounding a variable height object will expand as that object expands. For instance, if a variable height cell has a box around it, the box will expand automatically as the cell expands. You don’t need to check the Expandable option for the box.

Stacking Variable Height Objects

In the previous section expandable objects were arranged side by side. You can also stack variable height items vertically.

As each cell expands, it shifts the material below it, including any other expandable objects.

You can arrange expandable objects horizontally or vertically, but not both horizontally and vertically in the same report. The result of such a combination is usually unpredictable.

The Expand/Shrink Option

Expandable cells can grow to accommodate large amounts of data, but they can never get smaller. The Expand/Shrink option allows variable height objects to both grow and shrink as the data changes. If there is no data at all the object will shrink to nothing and disappear! In fact, this ability to make an object disappear completely is the main advantage of this option. If you don’t need the object to disappear completely we recommend using the Expandable option.

Expand/Shrink objects can be stacked vertically in a column, but they should never be placed side by side. When expand/shrink objects are placed side by side they fight each other and the result is unpredictable. In fact, you must be careful when placing an Expand/Shrink object next to anything else. You may find that an object placed next to an Expand/Shrink object also disappears, which is probably not what you had intended.

Mixing Variable Height Objects With Other Graphics

When variable height objects are mixed with other objects, the variable height objects can force the other objects to move or change size. The illustration below shows this effect. On the left is a variable height data cell. The illustration shows how four other graphic objects are affected by the variable height object.

When a variable height object expands or shrinks, everything in the area below the variable height object is affected. How the other objects are affected depends on their location relative to the bottom of this object. This edge is shown as an orange line in the illustration above (of course this line isn’t really visible).

Object A is completely above the orange line. It isn’t affected by the variable height data cell.

Object B touches the orange line, so it expands and shrinks in step with the variable height object.

Object C straddles the orange line, so it also expands and shrinks. If it shrinks too much it will disappear completely! (Of course that could be exactly what you want.)

Object D is completely below the orange line, so it slides up and down as the variable height object expands and contracts. It does not change size, however.

If there is more than one variable height object, the effect is cumulative. Panorama starts with the first variable height object (closest to the back) and works its way toward the front. For each variable height object the new height is calculated and all the other objects are adjusted.

These rules apply to other variable height objects as well as fixed height objects. If a second variable height object is partly or completely below another variable height object, it will be adjusted when the original variable height object expands or shrinks. You can use these rules to predict how unusual combinations of variable height objects will interact.


See Also


History

VersionStatusNotes
10.1UpdatedCarried over from Panorama 6.0, with some updates.