ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / HTML control
  • Overview
  • Control in a window, report, or static or dynamic page
  • Use in a page
  • Creating an HTML control
  • Creating an HTML control in a page
  • Creating an HTML control in a report
  • Control in a page: Characteristics
  • Description window
  • Assignment
  • Control in a report: Characteristics
  • Description window and 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

Control in a window, report, or static or dynamic page

The HTML control can be used:
  • WINDEVUniversal Windows 10 AppAndroidiPhone/iPad In a window.
    The HTML control of a window displays an HTML page.
    This control corresponds to the HTML Display control.
  • WEBDEV - Server codePHP In a page.
    The HTML control of a page displays or uses HTML code or JavaScript code. This code can correspond to HTML scripts. The HTML control does not display HTML pages or sites. It only displays HTML code.
  • WINDEVWEBDEV - Server codeWindowsUniversal Windows 10 AppAndroidiPhone/iPad In a report.
    The HTML control of a report can be used to print HTML code or the contents of a local page.
This help page presents only the HTML control in pages or reports. For windows, please see the page about the HTML Display control.
WEBDEV - Server codePHP

Use in a page

The HTML control of a page displays or uses HTML code or JavaScript code. This code can correspond to HTML scripts. The HTML control does not display HTML pages or sites. It only displays HTML code.
An HTML control can be programmed in server code only if the control is defined as "Dynamic". The HTML control cannot be associated with an item of a data file.
Caution:
  • When the control is defined as dynamic, you can only assign values programmatically.
  • The "Forbid the execution of JavaScript scripts" option is checked by default ("General" tab of the control description).
If the window displayed in the HTML control contains scripts and the user clicks the active areas of the HTML control (forms, tabs, etc.), the default browser opens and displays the URL of the HTML control to allow the user to run the scripts.
To allow the user to navigate inside the HTML control, uncheck "Forbid the execution of JavaScript scripts".
Creating an HTML control
WEBDEV - Server codePHP

Creating an HTML control in a page

To create an HTML control in a page:
  1. On the "Creation" tab, in the "Integration" group, click "HTML".
  2. Click where you want to create the control in the page. The control appears in the editor.
To view the characteristics of the control, select "Description" in the context menu.
WINDEVWEBDEV - Server codeWindowsUniversal Windows 10 AppAndroidiPhone/iPad

Creating an HTML control in a report

To create an HTML control in a report:
  1. On the "Creation" tab, in the "Text" group, click "HTML".
  2. Click where you want to create the control. The control appears in the editor.
To view the characteristics of the control, select "Description" in the context menu.
Remark: Starting with version 22, the HTML control of a report is an Static control of type HTML.
WEBDEV - Server codePHP
Control in a page: Characteristics

Description window

You can directly enter the HTML source code in the "General" tab of the control description window ("Edit HTML source code...").

Assignment

The encoding of the HTML code assigned programmatically or by data binding in an HTML control of a page, must correspond to the encoding of the page. If the encoding of the HTML code is not identical to that of the page, accents and special characters will not be rendered correctly.
For example, if HTML code is used in the HTML control of a WINDEV application, it will be encoded in UTF-8. The site must also use UTF-8:
  • On the "Project" tab, in the "Project" group, click "Description".
  • Select the "Language" tab.
  • Select the "Miscellaneous" tab.
  • Select "<UTF8>" in "Character set for ANSI configurations".
WINDEVWEBDEV - Server codeWindowsUniversal Windows 10 AppAndroidiPhone/iPad
Control in a report: Characteristics

Description window and programming

The HTML control is a Static control of type HTML. You can enter text directly in the "General" tab of the control description window.. This text will be automatically converted to HTML.
The HTML control displays:
  • the content of a local HTML file.
  • the HTML content of an item.
You can programmatically initialize the HTML control by assigning:
  • HTML code directly. For example:
    HTM_Code = "'''Hello'''"
  • the path of a local HTML file.
    HTM_Code = fExeDir() + "\MyHTMLFile.htm"
Remarks:
  • PNG and SVG images in the HTML content are not supported.
  • If the CSS style sheet corresponds to an external file, it is ignored.
  • All the external files that must be found on Internet are ignored.
  • JavaScript codes are not run.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/18/2023

Send a report | Local help