# Creating custom report script

{% hint style="warning" %}
With our upcoming release scheduled **for Q1 2026**, we will upgrade our reporting engine from DevExpress version 21.1.4 to 24.2.7. This upgrade brings improvements, but also changes to the scripting API that may cause your existing custom scripts to stop working if not updated.

#### **📌 What you need to do**

To ensure your scripts continue to function correctly:

* Review your custom report scripts.
* Refer to the DevExpress API Reference to update property and method usage where needed.\
  \&#xNAN;*For example:*

`FieldByName` is no longer valid. Use `GetFieldByName`, which now returns a `PivotGridFieldBase` instance.

* `XRPivotGridField` is now `XRPivotGridFieldBase`.<br>
* Script references like `PivotTableStatusPriorityCounts.Fields.FieldByName` should be updated to `PivotTableStatusPriorityCounts.Fields.GetFieldByName`.<br>

🗂 **References:**

[DevExpress API – XRPivotGridFieldCollection](https://docs.devexpress.com/XtraReports/DevExpress.XtraReports.UI.PivotGrid.XRPivotGridFieldCollection)

🗂 **Devexpress changelog:**

[https://supportcenter.devexpress.com/versionhistory](https://supportcenter.devexpress.com/versionhistory?utm_source=chatgpt.com)

####

#### 🆘 Need Assistance?

If you have troubles updating your report scripts, you will have an option to **submit a support ticket**, and the aqua team will help you adjust your custom scripts.

We’re here to support you during the transition!
{% endhint %}

{% hint style="warning" %}
📅 **What’s coming next?**\
We’ll keep you informed ahead of time of any changes
{% endhint %}

Scripting plays a key role in extending the functionality of aqua reports. It allows you to extend the capabilities of the report beyond just using the data contained within aqua. Scripting gives you the ability to enrich the report by extracting data from external sources such as databases or files. You also have the flexibility to save copies of the report to specific network drives and control which items are excluded from printing during each event band iteration.

To run a script on a particular event, you need to add a script function to the element's event. You can do this by linking a script method to the <mark style="background-color:blue;">Behaviour/Scripts</mark> property. This property lists all the events that the selected element will trigger. These can be different for different element types.

<figure><img src="https://3920520305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyZbW8vbNs5hz8x57emJJ%2Fuploads%2FSkwe7iNCFoPBqVyS9kQ3%2FReporting.Scripts.png?alt=media&#x26;token=35bc1ba5-0985-4ce3-8062-6c4290dd38da" alt=""><figcaption><p>Script linking view</p></figcaption></figure>

To change to the scripts view, click on ![](http://aquawiki.andagon.com/pictures/drex_script_development_1_custom_2.png). Here, you can add some functionality to your report: &#x20;

<figure><img src="http://aquawiki.andagon.com/pictures/drex_script_development_1_custom_3.png" alt=""><figcaption><p>script view</p></figcaption></figure>

### **Example: Apply different colour to areas** <a href="#example__apply_different_color_to_areas" id="example__apply_different_color_to_areas"></a>

The appearance can be modified with the event “OnPrintPage” &#x20;

<figure><img src="https://3920520305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyZbW8vbNs5hz8x57emJJ%2Fuploads%2FG2iQFMx7sA25pHKNOAo0%2Fimage.png?alt=media&#x26;token=6ef09b09-3a5b-4edd-9fd9-a6f693fd9e79" alt=""><figcaption></figcaption></figure>

The appearance doesn't necessarily have to be changed by the script. They can also be changed using formatting rules.

{% hint style="info" %}
For users in a SaaS environment: Please note that the report script can only be managed from the desktop client.&#x20;

The information on how to enable scripting mode for the On-Premise customers can be found in this [article](https://docs.aqua-cloud.io/documentation/installation-for-on-premise/server-parameters).
{% endhint %}
