PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • How to proceed?
  • Anchoring a control in a report
  • Print mode of a report and anchoring
  • Print preview of a report with anchoring
  • Finding out the anchoring characteristics by programming
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
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 management of control anchoring includes two parameters:
  • The anchor of control: 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, its size can be increased in width.
  • The anchor rate: this parameter is used to manage the percentage by which the control is moved or stretched. This parameter allows you to:
    • keep a control centered in width in the report regardless of its size,
    • proportionally enlarge some report controls.
These parameters can be configured in the report editor.
Notes:
  • 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).
How to proceed?

Anchoring a control in a report

To anchor a control in a report:
  1. Select one or more controls to anchor.
  2. Define the anchoring of controls:
    • in the "GUI" tab of the description window of control ("Description" from the popup menu of control),
    • via "Anchor" from the popup menu of the control.
      Note: If the print mode of the report is not suited for the anchors, the print mode can be changed from this window directly.
  3. In this window, choose the type of anchoring that will be used. The most common options are represented by icons:
    No anchorThe control is not modified when the report is resized. No anchoring option is selected.
    WidthThe control stretches to the right when the report is enlarged. To change the speed at which a control stretches in relation to the report, use the anchor rate in width.
    RightThe controls moves to the right when the report is enlarged. To make the control move slower or faster, use the anchor rate to right.
    Centered in widthThe control remains centered in width in the report regardless of the report width.
    No anchorThe control is not modified when the report is resized. No anchoring option is selected.
    WidthThe control stretches to the right when the report is enlarged. To change the speed at which a control stretches in relation to the report, use the anchor rate in width.
    RightThe controls moves to the right when the report is enlarged. To make the control move slower or faster, use the anchor rate to right.
    Centered in widthThe control remains centered in width in the report regardless of the report width.
    Versions 20 and later
    Height
    New in version 20
    Height
    Height
    The control stretches toward the bottom when the report height is enlarged. To change the speed at which a control stretches in relation to the report, use the anchor rate in height.
    Versions 20 and later
    Width and Height
    New in version 20
    Width and Height
    Width and Height
    The control stretches to the right and to the bottom when the report is enlarged. To change the speed at which a control stretches in relation to the report, use the anchor rate in height and the anchor rate in width.
    Versions 20 and later
    Height and Right
    New in version 20
    Height and Right
    Height and Right
    The control stretches toward the bottom and moves toward the right when the report is enlarged.
    To make the control move slower or faster, use the anchor rate to right.
    To change the speed at which a control stretches in relation to the report, use the anchor rate in height.
    Versions 20 and later
    Bottom
    New in version 20
    Bottom
    Bottom
    The control moves to the bottom when the report is enlarged toward the bottom. To make the control move slower or faster, use the anchor rate to bottom.
    Versions 20 and later
    Width and Bottom
    New in version 20
    Width and Bottom
    Width and Bottom
    The control stretches to the right and moves to the bottom when the report is enlarged.
    To make the control move slower or faster, use the anchor rate to bottom.
    To change the speed at which a control stretches in relation to the report, use the anchor rate in width.
    Versions 20 and later
    Right and Bottom
    New in version 20
    Right and Bottom
    Right and Bottom
    The control moves to the right and to the bottom when the report is enlarged. To make the control move slower or faster, use the anchor rate to bottom and the anchor rate to right.
    Versions 20 and later
    Horizontally centered at bottom
    New in version 20
    Horizontally centered at bottom
    Horizontally centered at bottom
    The control remains centered in width in the report regardless of the report width. However, the control is anchored to the right and it moves to the right when the report is enlarged.
    To make the control move slower or faster, use the anchor rate to bottom.
    Versions 20 and later
    Centered in height
    New in version 20
    Centered in height
    Centered in height
    The control remains centered in height inside the report regardless of the report height.
    Versions 20 and later
    Vertically centered to right
    New in version 20
    Vertically centered to right
    Vertically centered to right
    The control remains centered in height inside the report regardless of the report height. However, the control is anchored to the right and it moves to the right when the report is enlarged.
    To make the control move slower or faster, use the anchor rate to right.
    Versions 20 and later
    Centered
    New in version 20
    Centered
    Centered
    The control remains centered in height and in width inside the report regardless of the report size.
  4. Define (if necessary) the different anchor rates.
  5. Validate.
To display the anchoring markers in the control (red arrows), on the "Display" pane, in the "Viewing" group, check "Anchors and self-extensibility".
Notes:
  • The self-expandable controls are displayed in the report editor with a specific sign: a line with a down arrow.
  • At run time, a self-expandable control will be automatically enlarged in height if its size is too small to display its entire 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.
Print preview of a report with anchoring
When anchors are defined in a report, the print preview automatically proposes a list used to choose the display mode of the report.
Choice found in the
Choice found in the "Print" pane of the ribbon
The proposed choices correspond to:
  • the default paper format of the report proposed in portrait mode and in landscape mode.
  • the paper formats supported by the default printer of the computer.
Reminder: The iGroupXXX functions are used to customize the combo box for print preview by proposing several reports. See Print preview: Proposing several reports for more details.
Finding out the anchoring characteristics by programming
Several WLanguage properties allow you to find out the anchoring characteristics::
Versions 09 and later
Anchor
New in version 09
Anchor
Anchor
..Anchor is used to manage the anchor of a control in a window or report.
Versions 09 and later
AnchorRateBottom
New in version 09
AnchorRateBottom
AnchorRateBottom
..AnchorRateBottom 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.
Versions 09 and later
AnchorRateHeight
New in version 09
AnchorRateHeight
AnchorRateHeight
..AnchorRateHeight is used to:
  • Find out the anchor rate in height of a control.
  • Modify the anchor rate in height of a control.
Versions 09 and later
AnchorRateRight
New in version 09
AnchorRateRight
AnchorRateRight
..AnchorRateRight 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.
Versions 09 and later
AnchorRateWidth
New in version 09
AnchorRateWidth
AnchorRateWidth
..AnchorRateWidth 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.
Minimum required version
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment