How to Implement Nested Columns in a Script Report?

Hello, community!

I’m currently working on a script report in Frappe and I’m trying to implement nested columns. Specifically, I want to have sub-columns under an “Overdue” column, separated for “Customer” and “Vendor”.

Here’s a simplified version of what I have so far:

columns = [
    {"label": "Brand Name", "fieldname": "brand_visit_item", "fieldtype": "Data", "width": 150},
    {"label": "Overdue", "fieldname": "overdue", "fieldtype": "Float", "width": 100},
    # I want to have nested columns here for Customer and Vendor
]

I’m unsure about the best approach to achieve this. Should I modify how I define the columns or the data structure? Any guidance on how to implement this effectively would be greatly appreciated!

Thank you in advance for your help!

Columns will be only one heading.
Like Brand Name | Overdue

columns = [
    {"label": "Brand Name", "fieldname": "brand_visit_item", "fieldtype": "Data", "width": 150},
    {"label": "Overdue", "fieldname": "overdue", "fieldtype": "Float", "width": 100},
    # I want to have nested columns here for Customer and Vendor
]

But in the data the you will prepare in dictionary, that data thare is a key “indent”

“indent”: 0.0 → parent
“indent”: 1.0 → child

For reference check the code of Gross Profit report