Script files

By adding JavaScript files, you can integrate your own libraries or 3rd party libraries. These are useful if functions are required repeatedly or sophisticated code such as for charts is to be integrated. These files can be uploaded via the TcHmi server. The server stores the files at "TwinCAT:XAR.ReportingServer". The files stored here provide the corresponding functions. Pay attention to the order in which the files are initialized.

Adding a JavaScript file.

1. Open the server configuration page.
2. Go to the configuration of TcHmiReporting.
The General tab opens.
3. Open the path. If not available, create the path Runtimes/{Runtimename}/Configurations/{Configuration name}/Script files.
4. Click on Add to enter a new JS file and enter the following values:
File name: Name of the JS file
Sort order: Initialization order of the JS files
Parent tag: Embedding of the files in the HTML object (body or head)
The Reporting Extension of the HMI integrates the JS file.
5. Now add the JS file to the Reporting Server.
6. Switch to the User-defined configuration tab.
7. The JS file can be uploaded under Upload CSS/JavaScript file.
The file is automatically copied to the folder "C:\Program Files (x86)\Beckhoff\TwinCAT\Functions\Reporting-Server\Configuration\ReportScripts".
The JS file was successfully added.