|
|
|
|
|
- Overview
- How to?
- Anchoring a control in a report
- Print mode of a report and anchoring
- Report viewer: report with anchoring
- Finding out the anchoring characteristics through programming
Anchoring controls in a report
The anchors are used to define the behavior of controls during a resize operation. In a report, the anchoring is used to adapt the document when the user switches from Portrait mode to Landscape mode or when the paper format changes (A4, A3, ...). For example, a "tight" print in A4 format will be perfectly legible in A3 format.
The anchors of a control can be set using two parameters: - The control anchors: this parameter is used to define the modification that will be applied to the control according to the change of report size. The control can be moved to the left and resized horizontally.
- The anchor rate: this parameter sets the percentage by which the control is moved or stretched. This parameter allows you to:
- center a control horizontally regardless of the size of the report,
- proportionally enlarge some report controls.
These parameters can be configured in the report editor. Remarks: - Several WLanguage properties allow you to find out the anchoring characteristics defined in the editor. These properties cannot be used to modify the anchors defined in the editor.
- The anchoring is available for the controls only (it is not available for the blocks).
Anchoring a control in a report To anchor a control in a report: - Select the controls you want to anchor.
- Define the anchoring of controls:
- in the "UI" tab of the control description window ("Description" in the control popup menu),
- via "Anchor" from the popup menu of the control. Remark: If the print mode of the report is not suited for the anchors, the print mode can be changed from this window directly.
- In the window that appears, select the type of anchors to be applied. The most common options are represented by icons:
| | | | No anchors | The control does not change when the report is resized. No anchoring option is selected. | | Width | The control stretches to the right when the report is enlarged. Set the "width" anchor rate to define how much a control stretches relative to the report. | | Right | The controls moves to the right when the report is enlarged. Set the "right" anchor rate to define how much the control moves. | | Horizontally centered | The control remains centered horizontally regardless of the width of the report. | | Height | The control stretches downward when the report is enlarged vertically. Set the "height" anchor rate to define how much a control stretches relative to the report. | | Width and Height | The control stretches downward and to the right when the report is enlarged. Set the "width" and "height" anchor rates to define how much a control stretches relative to the report. | | Height and Right | The control stretches downward and moves to the right when the report is enlarged. Set the "right" anchor rate to define how much the control moves. Set the "height" anchor rate to define how much a control stretches relative to the report. | | Bottom | The control moves to the bottom when the report is enlarged toward the bottom. Set the "bottom" anchor rate to define how much the control moves. | | Width and Bottom | The control stretches to the right and moves to the bottom when the report is enlarged. Set the "bottom" anchor rate to define how much the control moves. Set the "width" anchor rate to define how much a control stretches relative to the report. | | Right and Bottom | The control moves to the right and to the bottom when the report is enlarged. Set the "bottom" and "right" anchor rates to define how much the control moves. | | Horizontally centered at bottom | The control remains centered horizontally regardless of the width of the report. However, the control is anchored to the right and it moves to the right when the report is enlarged. Set the "bottom" anchor rate to define how much the control moves. | | Vertically centered | The control remains centered vertically regardless of the height of the report. | | Vertically centered to right | The control remains centered vertically regardless of the height of the report. However, the control is anchored to the right and it moves to the right when the report is enlarged. Set the "right" anchor rate to define how much the control moves. | | Centered | The control remains centered vertically and horizontally regardless of the size of the report. |
- Define (if necessary) the different anchor rates.
- Validate.
To display the anchoring markers in the control (red arrows) go to the "Display" tab, "View" group and check "Anchors and auto-resizing". Remarks: - Auto-resizing controls are displayed in the report editor with a specific sign: a line with a down arrow.
- At runtime, an auto-resizing control will automatically stretch vertically if it is too small to display all its content.
Print mode of a report and anchoring By default, the anchors are not automatically enabled in the reports. A report can be printed according to three print modes: - Print the report as it is: In this case, the content exceeding the report size will not be printed.
- Automatically stretch or reduce to the supported format: The report is automatically stretched or reduced to adapt to the paper format.
- Stretch or reduce by applying the anchors: The report is adapted to the selected format by using the defined anchors.
These print modes can be selected or modified in the "Options" tab of the description window of the report. Report viewer: report with anchoring When anchors are defined in a report, the report viewer automatically provides a list to choose how the report is displayed.
Option in the "Print" tab of the ribbonThe proposed options correspond to: - the default paper format of the report in portrait and landscape mode.
- the paper formats supported by the default printer of the computer.
Finding out the anchoring characteristics through programming Several WLanguage properties allow you to find out the anchoring characteristics::
| | Anchor | The Anchor property sets the anchors of a control in a window, page or report. | AnchorRateBottom | The AnchorRateBottom property is used to:- Find out the anchor rate when a control moves on the vertical axis.
- Modify the anchor rate when a control moves on the vertical axis.
| AnchorRateHeight | The AnchorRateHeight property is used to:- Find out the vertical anchor rate of a control.
- Modify the vertical anchor rate of a control.
| AnchorRateRight | The AnchorRateRight property is used to:- Find out the anchor rate when a control moves on the horizontal axis.
- Modify the anchor rate when a control moves on the horizontal axis.
| AnchorRateWidth | The AnchorRateWidth property is used to:- Find out the anchor rate when a control (or a table column) stretches on the horizontal axis.
- Modify the anchor rate when a control (or a table column) stretches on the horizontal axis.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|