Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 49 additions & 2 deletions docs/FormEditor/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ You can add or modify 4D forms using the following elements:
}
```


## Using forms

Forms are called using specific commands of the 4D Language. In your 4D desktop applications, forms can be used in various ways, depending on their status within your interface needs. A form can be:

- used in its own window for data viewing, processing, editing, or to display on-screen information to the user,
- used as template for printing,
- used embedded in another form (subform),
- used as template for printing,
- or called by specific features like the Label editor.


Expand Down Expand Up @@ -154,6 +155,10 @@ In the same way that you pass an object to a form with the [`DIALOG`](../command

### Using forms to be printed

In 4D desktop applications, forms can be printed using the various [commands of the **Printing** theme](../commands/theme/Printing).

#### Examples

You can use forms to print data, either as page or as list.

- To simply print some part of a form, use the [`Print form`](../commands/print-form) command. For example:
Expand Down Expand Up @@ -190,6 +195,46 @@ var $h:=Print form("Request_var";$formData;Form detail)
FORM UNLOAD
CLOSE PRINTING JOB
```


#### Print rendering engine

4D uses a dedicated print rendering engine to generate outputs with a design adapted for printing. It includes the following main features:

- Interactive widgets such as buttons, toggles, dropdowns, etc. and modern UI effects such as glass, blur, transparency, or shadow effects are converted into adapted static representations and flattened into printable styles, so that the document remains readable and professional once printed.
- Layout structure, spacing, and alignment, are preserved so that the printed document reflects the logical structure of the on-screen form.
- The same output is produced, whether the form is printed from macOS or Windows.

For example, the following form:

![](../assets/en/FormEditor/screen_rendering.png)

... will be printed with this rendering:

![](../assets/en/FormEditor/print_rendering.png)


:::tip Related blog post

[Printing Modern Interfaces with Clean, Consistent Output](https://blog.4d.com/printing-modern-interfaces-with-clean-consistent-output)

:::

#### Legacy print renderer

In releases prior to 4D 21 R3, another print renderer was used. This legacy renderer simply draws widgets as they appear on the screen. For compatibility, the legacy renderer is **enabled by default** in projects or databases converted from versions prior to 4D 21 R3, so that forms designed with this renderer continue to be printed as expected.

You can however enable the modern print rendering engine at any moment by:

- unchecking the **Use legacy print rendering** option in the [Compatibility page of the Settings dialog box](../settings/compatibility.md) (permanent setting),
- or executing [`SET DATABASE PARAMETER`](../commands/set-database-parameter) command with `Use legacy print rendering` selector set to 1 (volatile setting).

:::warning Limitation

For technical reasons, the legacy print renderer is not available with forms displayed with [Fluent UI](#fluent-ui-rendering) on Windows or [Liquid Glass](../Notes/updates.md#support-of-liquid-glass-on-macos) on macOS. In these contexts, forms are **always printed with the modern print rendering engine**, whatever the compatibility option.

:::



### Other form usages
Expand All @@ -213,7 +258,7 @@ Typically, you select the form category when you create the form, but you can ch

## Form pages

Each form has is made of at least two pages:
Each form is made of at least two pages:

- a page 1: a main page, displayed by default
- a page 0: a background page, whose contents is displayed on every other page.
Expand All @@ -232,6 +277,8 @@ There are no restrictions on the number of pages a form can have. The same field
A multi-page form has both a background page and several display pages. Objects that are placed on the background page may be visible on all display pages, but can be selected and edited only on the background page. In multi-page forms, you should put your button palette on the background page. You also need to include one or more objects on the background page that provide page navigation tools for the user.




## Fluent UI rendering

:::caution Developer Preview
Expand Down
2 changes: 1 addition & 1 deletion docs/FormEditor/properties_Print.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: Print

Allows defining specific print settings for the form. This feature is useful to view printing page limits in the form editor.

> **Compatibility:** Even if these settings are taken into account when the form is printed in Application mode, it is discouraged to rely on this feature to store print settings for the form, due to limitations regarding the platform and driver dependency. It is highly recommended to use the 4D commands `Print settings to BLOB`/`BLOB to print settings` which are more powerful.
> **Compatibility:** Even if these settings are taken into account when the form is printed in Application mode, it is discouraged to rely on this feature to store print settings for the form, due to limitations regarding the platform and driver dependency. It is highly recommended to use the 4D commands [`Print settings to BLOB`](../commands/print-settings-to-blob)/[`BLOB to print settings`](../commands/blob-to-print-settings) which are more powerful.

You can modify the following print settings:

Expand Down
1 change: 1 addition & 0 deletions docs/Notes/updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Read [**What’s new in 4D 21 R3**](https://blog.4d.com/whats-new-in-4d-21-r3/),
- New [**AI** page in Settings](../settings/ai.md), allowing to configure [Provider model aliases](../aikit/provider-model-aliases.md) that can be called in the code using 4D AIKit component.
- 4D AIKit component: new [Providers](../aikit/Classes/OpenAIProviders.md) class to instantiate and handle [Provider and model aliases](../aikit/provider-model-aliases.md).
- Support of [`server` keyword](../Concepts/classes.md#server) for ORDA data model functions and shared/session singleton functions.
- New [printing renderer](../FormEditor/forms.md#print-rendering-engine) for forms on Liquid glass and Fluent UI interfaces. New compatibility options to [enable the renderer on Classic interfaces](../FormEditor/forms.md#legacy-print-renderer).
- Dependencies: support of [components stored on GitLab repositories](../Project/components.md#configuring-a-gitlab-repository).
- [**Fixed bug list**](https://bugs.4d.fr/fixedbugslist?version=21_R3): list of all bugs that have been fixed in 4D 21 R3.

Expand Down
Binary file added docs/assets/en/FormEditor/print_rendering.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/en/FormEditor/screen_rendering.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/en/commands/form-print1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/en/commands/form-print2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/en/commands/print-selection1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/en/commands/print-selection2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion docs/language-legacy/4D Environment/get-database-parameter.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ displayed_sidebar: docs

|Release|Changes|
|---|---|
|21 R3|Removed support of *Use legacy network layer*|
|21 R3|Removed support of *Use legacy network layer*, added *Use legacy print rendering*|
|20 R6|Modified|
|19 R5|Modified|
|16 R4|Modified|
Expand Down Expand Up @@ -1428,6 +1428,15 @@ In previous releases, time values were converted and stored as number of millise
Note that this parameter sets all 4D tips, i.e. form help messages and Design mode editor's tips.


### Use legacy print rendering (136)

**Scope:** 4D application

**Kept between two sessions:** No

**Possible values:** 0 = legacy print rendering disabled, 1 = legacy print rendering enabled

**Description:** Sets or gets the current status of the [legacy print renderer](../../FormEditor/forms.md#legacy-print-rendering) on macOS or Windows. When the legacy print renderer is *disabled*, 4D’s [modern print rendering engine](../../FormEditor/forms.md) is used. Note that when forms are rendered under Liquid Glass (macOS) or Fluent UI (Windows) interfaces, this selector is ignored (in such contexts forms are always printed using the modern print renderer, see [this section](../../FormEditor/forms.md#legacy-print-rendering)). In converted projects, this parameter can also be set permanently using a [compatibility setting](../../settings/compatibility.md).



Expand Down
15 changes: 13 additions & 2 deletions docs/language-legacy/4D Environment/set-database-parameter.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ displayed_sidebar: docs

|Release|Changes|
|---|---|
|21 R3|Removed support of *Use legacy network layer*|
|21 R3|Removed support of *Use legacy network layer*, added *Use legacy print rendering* |
|20 R6|Modified|
|20 R3|Modified|
|19 R5|Modified|
Expand Down Expand Up @@ -1035,6 +1035,15 @@ In previous releases, time values were converted and stored as number of millise
Note that this parameter sets all 4D tips, i.e. form help messages and Design mode editor's tips.


### Use legacy print rendering (136)

**Scope:** 4D application

**Kept between two sessions:** No

**Possible values:** 0 = legacy print rendering disabled, 1 = legacy print rendering enabled

**Description:** Sets or gets the current status of the [legacy print renderer](../../FormEditor/forms.md#legacy-print-rendering) on macOS or Windows. When the legacy print renderer is *disabled*, 4D’s [modern print rendering engine](../../FormEditor/forms.md) is used. Note that when forms are rendered under Liquid Glass (macOS) or Fluent UI (Windows) interfaces, this selector is ignored (in such contexts forms are always printed using the modern print renderer, see [this section](../../FormEditor/forms.md#legacy-print-rendering)). In converted projects, this parameter can also be set permanently using a [compatibility setting](../../settings/compatibility.md).


### User param value (108)
Expand All @@ -1047,7 +1056,9 @@ In previous releases, time values were converted and stored as number of millise

**Description:** Custom string passed from one session to the next one when the 4D application is restarted. This selector is useful in the context of automated unit tests that require applications to restart with different parameters.

When used with [SET DATABASE PARAMETER](../commands/set-database-parameter), defines a new value that will be available within the next opened database after 4D is restarted manually or using the [OPEN DATABASE](../commands/open-database)(\*), [OPEN DATA FILE](../commands/open-data-file), or [RESTART 4D](../commands/restart-4d) commands. When used with [Get database parameter](../commands/get-database-parameter), gets the currently available user parameter value, defined using a command line (see *Command Line Interface*), the .4DLink file (see *Using a 4DLink file*), or a call to [SET DATABASE PARAMETER](../commands/set-database-parameter) during the previous session. (\*) If [SET DATABASE PARAMETER](../commands/set-database-parameter) sets a User param value before a call to [OPEN DATABASE](../commands/open-database) with a .4DLink file that also contains a user-param xml attribute, 4D takes into account only the parameter provided by [SET DATABASE PARAMETER](../commands/set-database-parameter).
When used with [SET DATABASE PARAMETER](../commands/set-database-parameter), defines a new value that will be available within the next opened database after 4D is restarted manually or using the [OPEN DATABASE](../commands/open-database)(\*), [OPEN DATA FILE](../commands/open-data-file), or [RESTART 4D](../commands/restart-4d) commands. When used with [Get database parameter](../commands/get-database-parameter), gets the currently available user parameter value, defined using a command line (see [Command Line Interface](../../Admin/cli.md)), the .4DLink file (see [Using a 4DLink file](../../GettingStarted/creating.md#opening-a-project-with-a-4dlink-file)), or a call to [SET DATABASE PARAMETER](../commands/set-database-parameter) during the previous session.

(\*) If [SET DATABASE PARAMETER](../commands/set-database-parameter) sets a User param value before a call to [OPEN DATABASE](../commands/open-database) with a .4DLink file that also contains a user-param xml attribute, 4D takes into account only the parameter provided by [SET DATABASE PARAMETER](../commands/set-database-parameter).



Expand Down
Loading
Loading