[Also applies to v8]{class="badge positive" title="Also applies to Campaign v8"}
Advanced capabilities advanced-functionalities
As a technical user, in addition to general properties, you can leverage advanced capabilities to configure your reports, such as:
-
Create complex queries to process data in a Script activity. Learn more
-
Add an external script to execute on the server or client side. Learn more
-
Call a report with a Jump activity. Learn more
-
Add a URL parameter to a report to make it more accessible. Learn more
-
Add variables to be used in the context of the report. Learn more
Working with scripts adding-a-script
Reference external scripts external-script
You can reference JavaScript codes that will be executed on the client and/or server side when the report page is called up.
To do this:
-
Edit the report properties and click the Scripts.
-
Click Add and select the script to be referenced.
-
Then select the execution mode.
If you add several scripts, use the arrows of the toolbar to define their execution sequence.
For normal execution on the client side, the referenced scripts must be written in JavaScript and need to be compatible with common browsers. For more on this, refer to this section.
Adding a Script activity script-activity
When designing your report, use the Script activity to process data and easily create complex queries that don鈥檛 enable SQL language. You can directly enter your query in the script window.
The Texts tab enables you to define text strings. They may then be used with the following syntax: $(Identifier). For more on using texts, refer to Adding a header and a footer.
To create a history of your report, add the following line to your JavaScript query in order to save your archived data:
if( ctx.@_historyId.toString().length == 0 )
Otherwise, only current data will be displayed.
Adding a URL parameter defining-additional-settings
The Parameters tab of the report properties lets you define additional settings for the report: these settings will be passed into the URL during the call up.
To create a new setting:
-
Click the Add button and enter the name of the setting.
-
If necessary, specify whether or not the setting will be mandatory.
-
Select the type of setting you want to create: Filter or Variable.
The Filter entities option lets you use a field of the database as a parameter.
The data is recovered directly at the entity level: ctx/recipient/@account.
The Variable option lets you create or select a variable which will be passed as a parameter of the URL and can be used in the filters.
The Response HTTP headers allows you to prevent clickjacking when including your report鈥檚 page in an HTML page using iframe. To avoid clickjacking, you can choose the X-Frame-options header behavior:
- None: The report will have no X-Frame-options header.
- Same as origin: Set by default for new reports and republished reports. The hostname will be the same as the report鈥檚 URL.
- Deny: The report cannot be included in an HTML page using iframe.
Adding variables adding-variables
The Variables tab contains the list of variables configured in the report. These variables are exposed in the context of the report and can be used in calculations.
Click the Add button to create a new variable.
To view the definition of a variable, select it and click the 顿别迟补颈濒鈥 button.
Use Case: use variables and parameters in a report
In the video example below, you will learn how to add a 鈥淿type鈥 parameter to create different views of a report, based on the value of this attribute.
Calling up another report calling-up-another-report
A Jump activity is like a transition without an arrow: it lets you go from one activity to another or access another report.