The Horizontal Elasticity property specifies how the horizontal size of the object will change at runtime to accommodate the objects or data within it:
For frames and repeating frames, elasticity defines whether the size of the frame or repeating frame should vary with the objects inside of it.
For objects containing text, elasticity defines whether the field or boilerplate should vary with the size of the text. Fixed size text will wrap within the defined size of the object and may be truncated if there is not enough room. Number or date data will appear as asterisks if the data cannot fit within the defined size.
For images, drawings, and graph objects, Reports Builder uses proportional scaling. The elasticity options for images, drawings, and graph objects determine the scaling factor.
The following figure illustrates how the Horizontal Elasticity property is depicted in the Paper Layout view.
Applies to |
Layout objects | ||||||||
Values |
| ||||||||
Default |
Varies according to the object | ||||||||
Required/Optional |
Required |
Caution: If the contents of an object exceed its defined height, its Vertical and Horizontal Elasticity determine whether the contents overflow onto the next page or are truncated. Images, drawings, and chart objects cannot overflow. See the rules below for details about images, drawings, and graphs.
The table below shows the combinations of objects and elasticity choices that cause overflow and truncation. (Expand and Variable in the table apply if either the Vertical or Horizontal Elasticity is Expand or Variable.)
Object |
Fixed/ Contract |
Expand |
Variable |
repeating frame instances and frames (contents <= defined height) |
no overflow |
no overflow |
no overflow |
repeating frame instances and frames (contents > defined height or width) |
If both Horizontal and Vertical Elasticity of frame is Fixed or Contract but the field is variable or expandable, then overflow to the next page if frame and field are smaller than the data returned. If Horizontal and Vertical Elasticity of the field is Fixed or Contract then data is truncated. If the field is Contract or Fixed, then the data is truncated regardless of the frame. |
overflow, if unable to fit on the page |
overflow, if unable to fit on the page |
fields and boilerplate (contents <= defined height) |
no overflow |
no overflow |
no overflow |
fields and boilerplate (contents > defined height) |
truncate Note: To avoid truncation, set the field or boilerplate's Vertical Elasticity to Variable and surround it with a frame that has Fixed Vertical Elasticity. Note also, that when truncation of text occurs, it occurs after the field or boilerplate text has been wrapped. |
overflow, if unable to fit on the page |
overflow, if unable to fit on the page |
When formatting an object, if Vertical Elasticity is Fixed, Reports Builder will only format it on a logical page if the page has enough space to contain the entire object.
If Vertical Elasticity is Expand, Reports Builder will only format the object on a logical page if the page has enough space to contain the defined height of the object (that is, its minimum size). If formatting is not complete, the object overflows to the next page.
If Vertical Elasticity is Variable or Contract, Reports Builder will format as much of the object as possible on the first logical page and, if necessary, complete the object on the following logical page(s).
If a number cannot fit in its field, then asterisks will appear in the field instead of the value. To get the value to appear, you either need to resize the object or change its elasticity to Expand or Variable.
If the elasticity of the layout object is variable (that is, both Vertical and Horizontal Elasticity are Variable), then the contents will appear the same size as they do in their source (for example, the source file).
If the elasticity of the layout object is fixed (that is, both Vertical and Horizontal Elasticity are Fixed), then proportional scaling is performed on the contents. In some cases, this may lead to empty space or "gaps" between the contents and the border of the object. For example, if an object is fixed both horizontally and vertically and the image is too large for the object, then the image will only fill the object in one direction. In the other direction, the image will be shorter than the object. To avoid these gaps, you can either change the elasticity (for example, make it variable horizontally, vertically, or both) or you can manually resize the object.
If an object containing an image, drawing, or graph is Fixed in only one direction, Reports Builder will always attempt to have the contents fill up the Fixed dimension.
If the elasticity of the object is Contract in one direction and Fixed in the other, the contents may be clipped. To avoid clipping of the contents, you can either change the elasticity (for example, make it Variable both horizontally and vertically) or you can manually resize the object.
If the elasticity of the object is variable (that is, Vertical or Horizontal Elasticity is Variable) and the object cannot fit in its enclosing object (for example, a frame or the logical page), the report will infinitely loop (because the object can never format).
If a value to be displayed in the report output relies on the formatting of the report, then the field or boilerplate object that displays the value must have a Vertical and Horizontal Elasticity of Fixed. (This is sometimes referred to as page-dependent referencing.) If the elasticity is not fixed, Reports Builder will change it to be fixed at runtime.
A typical case of page-dependent referencing is a field that has a Source of &Total Logical Pages. The total number of logical pages cannot be determined until the entire report has been formatted. But Reports Builder must format the field before the end of the report and cannot wait until the report is completely formatted to determine how big to make the field. Consequently, the field's elasticity must be fixed, so that Reports Builder knows how much space to reserve for it before its source value is determined.
In page-dependent referencing, a field or boilerplate object's elasticity must be fixed because its source value depends on the formatting of the report:
If a summary column has a Reset At or Compute At of Page, then the field or boilerplate object that displays its value must have fixed elasticity.
If a formula or summary column relies on a summary column that has a Reset At or Compute At of Page, then the field or boilerplate object that displays its value must have fixed elasticity.
If the Source of a field is &Logical Page Number, &Panel Number, &Physical Page Number, &Total Logical Pages, &Total Panels, or &Total Physical Pages, then any object that displays the field (either the field itself or a boilerplate object) must have fixed elasticity.
If a field has a page number as its Source and, in the Page Numbering dialog box, Reset At is a repeating frame, then any layout object that displays its value must have fixed elasticity.
If a field containing a page-dependent reference has Visible set to No, then the field may have Horizontal Elasticity of Variable, Expand, or Contract. Any boilerplate object that references the field, though, must be fixed in elasticity.
If you want your data truncated, you should use the SQL SUBSTR function in your query. For example, if you want only the first four characters of a column, then use SUBSTR in your SELECT statement to retrieve only those characters from the database.
Suppose that you have a field with the following characteristics:
Characteristic |
Value |
width |
1 inch |
Horizontal Elasticity |
Contract |
height |
1 inch |
Vertical Elasticity |
Fixed |
Note that when the data is less than one inch wide the size of the field decreases to the minimum size necessary to hold the data. It is also important to note here that if the data was more than one inch long, it would be truncated because the field cannot expand vertically or horizontally.
Suppose that you have a frame named M_1 with the following characteristics:
Characteristic |
Value |
Horizontal Elasticity |
Variable |
height |
7 inches |
Vertical Elasticity |
Fixed |
Assume further that the Page Width you defined in the report property sheet is eight inches. M_1 contains a repeating frame with one field, F_Ename. The first value of F_Ename is four inches wide, the next value is 3 inches, the next is four inches, and the last is four inches. The following diagram shows how the frame might be formatted:
Note that the first two instances of field F_Ename print on the first logical page, but, the second two instances, because there is not enough room on the first logical page, print on the second logical page. It is also important to note that if the Horizontal Elasticity was Contract or Fixed, instead of Variable, the frame would not print unless it could fit entirely on one logical page.
Copyright © 1984, 2005, Oracle. All rights reserved.