Centralize Python code for reuse in Office reports
Product line
Standard
|Expert
Operating mode
CLOUD ABO
|ON-PREMISES
Modules
Services & CRM
Budget & Phases
Purchases
Resource Planning
Business Intelligence
If you want to centralize Python code for office reports , i.e. use the same code base for several report templates, you can do this as follows:
Create a script entry. It will be registered without class specification and without event specification. The designation must not contain spaces. Here in the example we call it report_code
, but you can choose the designation as you like.
Paste the Python code of the Office report in the Script Text field.
In order for the script to know the reporting framework, the following modules must also be imported:
import vtcapp from reporting.table import Table from reporting.fields import *
It looks like this:
The code is then imported into the Office report:
from report_code import *
If extended user rights are required, check the Office report where the script code will be imported.