PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • 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
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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 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).
How to?

Anchoring a control in a report

To anchor a control in a report:
  1. Select the controls you want to anchor.
  2. 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.
  3. In the window that appears, select the type of anchors to be applied. The most common options are represented by icons:
    No anchorsThe control does not change when the report is resized. No anchoring option is selected.
    WidthThe 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.
    RightThe controls moves to the right when the report is enlarged. Set the "right" anchor rate to define how much the control moves.
    Horizontally centeredThe control remains centered horizontally regardless of the width of the report.
    HeightThe 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 HeightThe 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 RightThe 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.
    BottomThe 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 BottomThe 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 BottomThe 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 bottomThe 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 centeredThe control remains centered vertically regardless of the height of the report.
    Vertically centered to rightThe 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.
    CenteredThe control remains centered vertically and horizontally regardless of the size of the report.
  4. Define (if necessary) the different anchor rates.
  5. 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 ribbon
The 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.
Reminder: The iGroupXXX functions allow you to customize the report viewer combo box by showing multiple types of reports. For more details, see Report viewer: Proposing several reports.
Finding out the anchoring characteristics through programming
Several WLanguage properties allow you to find out the anchoring characteristics::
AnchorThe Anchor property is used to set the anchors of a control in a window, page or report.
AnchorRateBottomThe 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.
AnchorRateRightThe 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.
AnchorRateHeightThe AnchorRateHeight property is used to:
  • Find out the vertical anchor rate of a control.
  • Modify the vertical anchor rate of a control.
AnchorRateWidthThe 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.
Minimum version required
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment