from django.db.models import Q, Sum, F, Count

from contribution.models import Premium
from insuree.models import InsureePolicy
from location.models import Location
from product.models import Product

template = """
{
    "docElements": [
        {
            "elementType": "text",
            "id": 3,
            "containerId": "0_header",
            "x": 120,
            "y": 20,
            "width": 575,
            "height": 40,
            "content": "Payment Category Overview",
            "richText": false,
            "richTextContent": null,
            "richTextHtml": "",
            "eval": false,
            "styleId": "",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#006374",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": "24",
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": 1,
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": 2,
            "paddingTop": 2,
            "paddingRight": 2,
            "paddingBottom": 2,
            "printIf": "",
            "removeEmptyElement": false,
            "alwaysPrintOnSamePage": true,
            "pattern": "",
            "link": "",
            "cs_condition": "",
            "cs_styleId": "",
            "cs_bold": false,
            "cs_italic": false,
            "cs_underline": false,
            "cs_strikethrough": false,
            "cs_horizontalAlignment": "left",
            "cs_verticalAlignment": "top",
            "cs_textColor": "#000000",
            "cs_backgroundColor": "",
            "cs_font": "helvetica",
            "cs_fontSize": 12,
            "cs_lineSpacing": 1,
            "cs_borderColor": "#000000",
            "cs_borderWidth": "1",
            "cs_borderAll": false,
            "cs_borderLeft": false,
            "cs_borderTop": false,
            "cs_borderRight": false,
            "cs_borderBottom": false,
            "cs_paddingLeft": 2,
            "cs_paddingTop": 2,
            "cs_paddingRight": 2,
            "cs_paddingBottom": 2,
            "spreadsheet_hide": false,
            "spreadsheet_column": "",
            "spreadsheet_colspan": "",
            "spreadsheet_addEmptyRow": false,
            "spreadsheet_textWrap": false
        },
        {
            "elementType": "line",
            "id": 158,
            "containerId": "0_content",
            "x": 0,
            "y": 0,
            "width": 820,
            "height": 1,
            "color": "#000000",
            "printIf": ""
        },
        {
            "elementType": "table",
            "id": 297,
            "containerId": "0_content",
            "width": 630,
            "x": 100,
            "y": 183,
            "dataSource": "",
            "columns": "2",
            "header": false,
            "contentRows": "1",
            "footer": false,
            "border": "grid",
            "borderColor": "#000000",
            "borderWidth": "1",
            "printIf": "${error}",
            "removeEmptyElement": false,
            "spreadsheet_hide": false,
            "spreadsheet_column": "",
            "spreadsheet_addEmptyRow": false,
            "headerData": {
                "elementType": "none",
                "id": 298,
                "height": 20,
                "backgroundColor": "",
                "repeatHeader": false,
                "columnData": [
                    {
                        "elementType": "table_text",
                        "id": 299,
                        "width": 260,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 300,
                        "width": 370,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    }
                ]
            },
            "contentDataRows": [
                {
                    "elementType": "none",
                    "id": 301,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 302,
                            "width": 260,
                            "content": "${error}",
                            "eval": false,
                            "colspan": "2",
                            "styleId": "307",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#ff0000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "16",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 303,
                            "width": 370,
                            "content": "${error}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#ff0000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                }
            ],
            "footerData": {
                "elementType": "none",
                "id": 304,
                "height": 20,
                "backgroundColor": "",
                "columnData": [
                    {
                        "elementType": "table_text",
                        "id": 305,
                        "width": 260,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 306,
                        "width": 370,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    }
                ]
            }
        },
        {
            "elementType": "table",
            "id": 262,
            "containerId": "0_content",
            "width": 360,
            "x": 240,
            "y": 20,
            "dataSource": "${header}",
            "columns": "2",
            "header": false,
            "contentRows": 5,
            "footer": false,
            "border": "grid",
            "borderColor": "#000000",
            "borderWidth": "1",
            "printIf": "",
            "removeEmptyElement": false,
            "spreadsheet_hide": false,
            "spreadsheet_column": "",
            "spreadsheet_addEmptyRow": false,
            "headerData": {
                "elementType": "none",
                "id": 263,
                "height": 20,
                "backgroundColor": "",
                "repeatHeader": false,
                "columnData": [
                    {
                        "elementType": "table_text",
                        "id": 264,
                        "width": 100,
                        "content": "From",
                        "eval": false,
                        "colspan": "",
                        "styleId": "33",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": "12",
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 265,
                        "width": 260,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "34",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": "11",
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    }
                ]
            },
            "contentDataRows": [
                {
                    "elementType": "none",
                    "id": 280,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 281,
                            "width": 100,
                            "content": "Region",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 282,
                            "width": 260,
                            "content": "${region}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "34",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 283,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 284,
                            "width": 100,
                            "content": "District",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 285,
                            "width": 260,
                            "content": "${district}",
                            "eval": true,
                            "colspan": "",
                            "styleId": "34",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 555,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 556,
                            "width": 100,
                            "content": "Product",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 557,
                            "width": 260,
                            "content": "${product}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "34",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 561,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 562,
                            "width": 100,
                            "content": "Date from",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 563,
                            "width": 260,
                            "content": "${date_from}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "34",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 564,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 565,
                            "width": 100,
                            "content": "Date to",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 566,
                            "width": 260,
                            "content": "${date_to}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "34",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                }
            ],
            "footerData": {
                "elementType": "none",
                "id": 269,
                "height": 20,
                "backgroundColor": "",
                "columnData": [
                    {
                        "elementType": "table_text",
                        "id": 270,
                        "width": 100,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 271,
                        "width": 260,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    }
                ]
            }
        },
        {
            "elementType": "table",
            "id": 195,
            "containerId": "0_content",
            "width": 822,
            "x": 0,
            "y": 139,
            "dataSource": "${data}",
            "columns": 7,
            "header": false,
            "contentRows": 5,
            "footer": true,
            "border": "grid",
            "borderColor": "#000000",
            "borderWidth": "1",
            "printIf": "",
            "removeEmptyElement": false,
            "spreadsheet_hide": false,
            "spreadsheet_column": "",
            "spreadsheet_addEmptyRow": false,
            "headerData": {
                "elementType": "none",
                "id": 196,
                "height": 20,
                "backgroundColor": "",
                "repeatHeader": true,
                "columnData": [
                    {
                        "elementType": "table_text",
                        "id": 197,
                        "width": 42,
                        "content": "Username: {user_name}",
                        "eval": false,
                        "colspan": "4",
                        "styleId": "286",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "middle",
                        "textColor": "#ffffff",
                        "backgroundColor": "#006374",
                        "font": "notosans",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 206,
                        "width": 80,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "33",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": "12",
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 592,
                        "width": 180,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 381,
                        "width": 130,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 391,
                        "width": 130,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 401,
                        "width": 130,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 599,
                        "width": 130,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    }
                ]
            },
            "contentDataRows": [
                {
                    "elementType": "none",
                    "id": 496,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "${district_code}",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 497,
                            "width": 42,
                            "content": "",
                            "eval": false,
                            "colspan": "2",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 499,
                            "width": 80,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 593,
                            "width": 180,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 501,
                            "width": 130,
                            "content": "Registration fees",
                            "eval": false,
                            "colspan": "1",
                            "styleId": "349",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 502,
                            "width": 130,
                            "content": "Assembly fees",
                            "eval": false,
                            "colspan": "",
                            "styleId": "349",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 503,
                            "width": 130,
                            "content": "Contributions",
                            "eval": false,
                            "colspan": "",
                            "styleId": "349",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 600,
                            "width": 130,
                            "content": "Photo fees",
                            "eval": false,
                            "colspan": "",
                            "styleId": "349",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 257,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "${district_code}",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 258,
                            "width": 42,
                            "content": "District: ${district_code} ${district_name}",
                            "eval": false,
                            "colspan": "9",
                            "styleId": "286",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#ffffff",
                            "backgroundColor": "#006374",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 260,
                            "width": 80,
                            "content": "Description",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 594,
                            "width": 180,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 382,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 392,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 402,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 601,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 571,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 572,
                            "width": 42,
                            "content": "",
                            "eval": false,
                            "colspan": "2",
                            "styleId": "338",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#cccccc",
                            "backgroundColor": "#cccccc",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 0,
                            "paddingTop": 0,
                            "paddingRight": 0,
                            "paddingBottom": 0,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 573,
                            "width": 80,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 595,
                            "width": 180,
                            "content": "${product_code} - ${product_name}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "296",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 574,
                            "width": 130,
                            "content": "${product_total_r}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "296",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 575,
                            "width": 130,
                            "content": "${product_total_a}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "296",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 576,
                            "width": 130,
                            "content": "${product_total_c}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "296",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 602,
                            "width": 130,
                            "content": "${product_total_p}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "296",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 361,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "${district_code}",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 362,
                            "width": 42,
                            "content": "Total for district ${district_code}:",
                            "eval": false,
                            "colspan": "3",
                            "styleId": "",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "right",
                            "verticalAlignment": "middle",
                            "textColor": "#006374",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 364,
                            "width": 80,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 596,
                            "width": 180,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 388,
                            "width": 130,
                            "content": "${district_total_r}",
                            "eval": false,
                            "colspan": "1",
                            "styleId": "615",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#006374",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 398,
                            "width": 130,
                            "content": "${district_total_a}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "615",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#006374",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 408,
                            "width": 130,
                            "content": "${district_total_c}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "615",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#006374",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 603,
                            "width": 130,
                            "content": "${district_total_p}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "615",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#006374",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 199,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "${district_code}",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 200,
                            "width": 42,
                            "content": "",
                            "eval": false,
                            "colspan": "9",
                            "styleId": "338",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#cccccc",
                            "backgroundColor": "#cccccc",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 0,
                            "paddingTop": 0,
                            "paddingRight": 0,
                            "paddingBottom": 0,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 209,
                            "width": 80,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "yyyy/MM/dd",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 597,
                            "width": 180,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 389,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 399,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 409,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 604,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                }
            ],
            "footerData": {
                "elementType": "none",
                "id": 202,
                "height": 20,
                "backgroundColor": "",
                "columnData": [
                    {
                        "elementType": "table_text",
                        "id": 203,
                        "width": 42,
                        "content": "Grand Total:",
                        "eval": false,
                        "colspan": "3",
                        "styleId": "349",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "center",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 212,
                        "width": 80,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 598,
                        "width": 180,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 390,
                        "width": 130,
                        "content": "${total_r}",
                        "eval": false,
                        "colspan": "1",
                        "styleId": "349",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "center",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 400,
                        "width": 130,
                        "content": "${total_a}",
                        "eval": false,
                        "colspan": "",
                        "styleId": "349",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "center",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 410,
                        "width": 130,
                        "content": "${total_c}",
                        "eval": false,
                        "colspan": "",
                        "styleId": "349",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "center",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 605,
                        "width": 130,
                        "content": "${total_p}",
                        "eval": false,
                        "colspan": "",
                        "styleId": "349",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "center",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    }
                ]
            }
        },
        {
            "elementType": "text",
            "id": 7,
            "containerId": "0_footer",
            "x": 567,
            "y": 0,
            "width": 255,
            "height": 30,
            "content": "Page ${page_number} / ${page_count}",
            "richText": false,
            "richTextContent": null,
            "richTextHtml": "",
            "eval": false,
            "styleId": "",
            "bold": false,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "right",
            "verticalAlignment": "middle",
            "textColor": "#666666",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": 1,
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": 2,
            "paddingTop": 2,
            "paddingRight": 2,
            "paddingBottom": 2,
            "printIf": "",
            "removeEmptyElement": false,
            "alwaysPrintOnSamePage": true,
            "pattern": "",
            "link": "",
            "cs_condition": "",
            "cs_styleId": "",
            "cs_bold": false,
            "cs_italic": false,
            "cs_underline": false,
            "cs_strikethrough": false,
            "cs_horizontalAlignment": "left",
            "cs_verticalAlignment": "top",
            "cs_textColor": "#000000",
            "cs_backgroundColor": "",
            "cs_font": "helvetica",
            "cs_fontSize": 12,
            "cs_lineSpacing": 1,
            "cs_borderColor": "#000000",
            "cs_borderWidth": "1",
            "cs_borderAll": false,
            "cs_borderLeft": false,
            "cs_borderTop": false,
            "cs_borderRight": false,
            "cs_borderBottom": false,
            "cs_paddingLeft": 2,
            "cs_paddingTop": 2,
            "cs_paddingRight": 2,
            "cs_paddingBottom": 2,
            "spreadsheet_hide": false,
            "spreadsheet_column": "",
            "spreadsheet_colspan": "",
            "spreadsheet_addEmptyRow": false,
            "spreadsheet_textWrap": false
        },
        {
            "elementType": "text",
            "id": 8,
            "containerId": "0_footer",
            "x": 0,
            "y": 0,
            "width": 290,
            "height": 30,
            "content": "Created on ${current_date}",
            "richText": false,
            "richTextContent": null,
            "richTextHtml": "",
            "eval": false,
            "styleId": "",
            "bold": false,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "middle",
            "textColor": "#666666",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": 1,
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": 2,
            "paddingTop": 2,
            "paddingRight": 2,
            "paddingBottom": 2,
            "printIf": "",
            "removeEmptyElement": false,
            "alwaysPrintOnSamePage": true,
            "pattern": "",
            "link": "",
            "cs_condition": "",
            "cs_styleId": "",
            "cs_bold": false,
            "cs_italic": false,
            "cs_underline": false,
            "cs_strikethrough": false,
            "cs_horizontalAlignment": "left",
            "cs_verticalAlignment": "top",
            "cs_textColor": "#000000",
            "cs_backgroundColor": "",
            "cs_font": "helvetica",
            "cs_fontSize": 12,
            "cs_lineSpacing": 1,
            "cs_borderColor": "#000000",
            "cs_borderWidth": "1",
            "cs_borderAll": false,
            "cs_borderLeft": false,
            "cs_borderTop": false,
            "cs_borderRight": false,
            "cs_borderBottom": false,
            "cs_paddingLeft": 2,
            "cs_paddingTop": 2,
            "cs_paddingRight": 2,
            "cs_paddingBottom": 2,
            "spreadsheet_hide": false,
            "spreadsheet_column": "",
            "spreadsheet_colspan": "",
            "spreadsheet_addEmptyRow": false,
            "spreadsheet_textWrap": false
        }
    ],
    "parameters": [
        {
            "id": 1,
            "name": "page_count",
            "type": "number",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "",
            "expression": "",
            "showOnlyNameType": true,
            "testData": ""
        },
        {
            "id": 2,
            "name": "page_number",
            "type": "number",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "",
            "expression": "",
            "showOnlyNameType": true,
            "testData": ""
        },
        {
            "id": 9,
            "name": "current_date",
            "type": "date",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "d/M/yyyy H:mm",
            "expression": "",
            "showOnlyNameType": false,
            "testData": ""
        },
        {
            "id": 272,
            "name": "data",
            "type": "array",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "",
            "expression": "",
            "showOnlyNameType": false,
            "testData": "",
            "children": [
                {
                    "id": 273,
                    "name": "row_number",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": true,
                    "testData": ""
                },
                {
                    "id": 321,
                    "name": "district_code",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 322,
                    "name": "district_name",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 585,
                    "name": "product_code",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 586,
                    "name": "product_name",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 590,
                    "name": "district_total_r",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "$ #,##0.00",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 591,
                    "name": "product_total_r",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "$ #,##0.00",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 606,
                    "name": "district_total_a",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "$ #,##0.00",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 607,
                    "name": "district_total_c",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "$ #,##0.00",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 608,
                    "name": "district_total_p",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "$ #,##0.00",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 609,
                    "name": "product_total_a",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "$ #,##0.00",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 610,
                    "name": "product_total_c",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "$ #,##0.00",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 611,
                    "name": "product_total_p",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "$ #,##0.00",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                }
            ]
        },
        {
            "id": 274,
            "name": "header",
            "type": "array",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "",
            "expression": "",
            "showOnlyNameType": false,
            "testData": "",
            "children": [
                {
                    "id": 275,
                    "name": "row_number",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": true,
                    "testData": ""
                },
                {
                    "id": 278,
                    "name": "region",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 279,
                    "name": "district",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 567,
                    "name": "product",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 569,
                    "name": "date_from",
                    "type": "date",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "dd/MM/yyyy",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 570,
                    "name": "date_to",
                    "type": "date",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "dd/MM/yyyy",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                }
            ]
        },
        {
            "id": 309,
            "name": "error",
            "type": "string",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "",
            "expression": "",
            "showOnlyNameType": false,
            "testData": ""
        },
        {
            "id": 542,
            "name": "total_a",
            "type": "number",
            "arrayItemType": "string",
            "eval": false,
            "nullable": true,
            "pattern": "$ #,##0.00",
            "expression": "",
            "showOnlyNameType": false,
            "testData": ""
        },
        {
            "id": 612,
            "name": "total_r",
            "type": "number",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "$ #,##0.00",
            "expression": "",
            "showOnlyNameType": false,
            "testData": ""
        },
        {
            "id": 613,
            "name": "total_c",
            "type": "number",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "$ #,##0.00",
            "expression": "",
            "showOnlyNameType": false,
            "testData": ""
        },
        {
            "id": 614,
            "name": "total_p",
            "type": "number",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "$ #,##0.00",
            "expression": "",
            "showOnlyNameType": false,
            "testData": ""
        }
    ],
    "styles": [
        {
            "id": 33,
            "name": "Table Header",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "middle",
            "textColor": "#000000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": "12",
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 34,
            "name": "Table Content",
            "bold": false,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "middle",
            "textColor": "#000000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": "11",
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 35,
            "name": "Table Content Highlight",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#3d85c6",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": "9",
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 286,
            "name": "Content header 1",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "middle",
            "textColor": "#ffffff",
            "backgroundColor": "#006374",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 295,
            "name": "Content title",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#000000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 296,
            "name": "Content content",
            "bold": false,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#000000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": "11",
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 307,
            "name": "Error",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#ff0000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": "16",
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 337,
            "name": "Content header 2",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "middle",
            "textColor": "#ffffff",
            "backgroundColor": "#80B0B9",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 338,
            "name": "No content",
            "bold": false,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "top",
            "textColor": "#cccccc",
            "backgroundColor": "#cccccc",
            "font": "helvetica",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "",
            "paddingTop": "",
            "paddingRight": "",
            "paddingBottom": ""
        },
        {
            "id": 341,
            "name": "Content header 3",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "middle",
            "textColor": "#ffffff",
            "backgroundColor": "#F4AE2B",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 349,
            "name": "Footer",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#000000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 366,
            "name": "Subtotals",
            "bold": false,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "right",
            "verticalAlignment": "middle",
            "textColor": "#000000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 615,
            "name": "Colored subtotal 1",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#006374",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        }
    ],
    "version": 3,
    "documentProperties": {
        "pageFormat": "A4",
        "pageWidth": "",
        "pageHeight": "",
        "unit": "mm",
        "orientation": "landscape",
        "contentHeight": "",
        "marginLeft": "10",
        "marginTop": "10",
        "marginRight": "10",
        "marginBottom": "10",
        "header": true,
        "headerSize": "80",
        "headerDisplay": "always",
        "footer": true,
        "footerSize": "30",
        "footerDisplay": "always",
        "patternLocale": "en",
        "patternCurrencySymbol": "$"
    }
}
"""

ALL_REGIONS = -42
ALL_DISTRICTS = -4242
ALL_PRODUCTS = -424242

CATEGORY_PHOTO = "P"
CATEGORY_REGISTRATION = "R"
CATEGORY_ASSEMBLY = "A"
CATEGORY_CONTRIBUTION = "C"


def coalesce_or_0(*args):
    # Returns the first non-null value given or 0
    for arg in args:
        if arg:
            return arg
    return 0


def generate_subtotal():
    return {
        CATEGORY_REGISTRATION: 0,
        CATEGORY_ASSEMBLY: 0,
        CATEGORY_CONTRIBUTION: 0,
        CATEGORY_PHOTO: 0,
    }


def dispatch_subtotals(district_id: int, product_id: int, amount: int, subtotals: dict, category: str):
    # Dispatches subtotals per district, per product, as well a global total
    # The subtotals' structure is the following:
    # { district_id: {
    #       product_id: {
    #           categories: value
    #       },
    #       "total": { # for the district
    #           categories: value
    #       },
    #   },
    #   "total": { # grand total
    #       categories: value
    #   },
    # }
    if district_id not in subtotals:
        subtotals[district_id] = {
            product_id: generate_subtotal(),
            "total": generate_subtotal(),
        }
    elif product_id not in subtotals[district_id]:
        subtotals[district_id][product_id] = generate_subtotal()

    subtotals[district_id][product_id][category] += amount
    subtotals[district_id]["total"][category] += amount
    subtotals["total"][category] += amount


def split_premium_in_categories(premium: dict, subtotals: dict, product_info_mapping: dict, family_members_in_policy: dict):
    # This function is the main/trickiest part of this report.
    # The business logic is: if there are any registration or assembly cost, they should be paid first.
    # These costs are either a lump sum or a fee, the latter being calculated as "base_fee * number_of_people_in_policy"
    # Then, if there is still some money left, the remaining amount is contributions.
    # So, the order of categories is: 1-registration, 2-assembly, 3-contributions

    # Preparing all the data that will be used in the calculations
    remaining_amount = premium["amount"]
    district_id = premium["district_id"]
    product_id = premium["product_id"]
    registration_lump_sum = product_info_mapping[product_id]["registration_lump_sum"]
    registration_fee = coalesce_or_0(product_info_mapping[product_id]["registration_fee"])
    registration_fees = registration_fee * family_members_in_policy[premium["policy_id"]]
    assembly_lump_sum = product_info_mapping[product_id]["assembly_lump_sum"]
    assembly_fee = coalesce_or_0(product_info_mapping[product_id]["assembly_fee"])
    assembly_fees = assembly_fee * family_members_in_policy[premium["policy_id"]]

    # 1) checking if there is any type of registration
    registration_amount = coalesce_or_0(registration_lump_sum, registration_fees)
    if registration_amount:
        if registration_amount <= remaining_amount:
            remaining_amount -= registration_amount
            dispatch_subtotals(district_id,
                               product_id,
                               registration_amount,
                               subtotals,
                               CATEGORY_REGISTRATION)
        else:
            dispatch_subtotals(district_id,
                               product_id,
                               remaining_amount,
                               subtotals,
                               CATEGORY_REGISTRATION)
            remaining_amount = 0

    # 2) checking if there is any type of assembly
    assembly_amount = coalesce_or_0(assembly_lump_sum, assembly_fees)
    if assembly_amount:
        if assembly_amount <= remaining_amount:
            remaining_amount -= assembly_amount
            dispatch_subtotals(district_id,
                               product_id,
                               assembly_amount,
                               subtotals,
                               CATEGORY_ASSEMBLY)
        else:
            dispatch_subtotals(district_id,
                               product_id,
                               remaining_amount,
                               subtotals,
                               CATEGORY_ASSEMBLY)
            remaining_amount = 0

    # 3) if there is anything left, it's contributions
    if remaining_amount:
        dispatch_subtotals(district_id,
                           product_id,
                           remaining_amount,
                           subtotals,
                           CATEGORY_CONTRIBUTION)


def format_totals(subtotals: dict, report_data: dict):
    # Adds and formats total figures to the report data
    report_data["total_r"] = subtotals["total"][CATEGORY_REGISTRATION]
    report_data["total_a"] = subtotals["total"][CATEGORY_ASSEMBLY]
    report_data["total_c"] = subtotals["total"][CATEGORY_CONTRIBUTION]
    report_data["total_p"] = subtotals["total"][CATEGORY_PHOTO]


def format_final_data(subtotals: dict, district_info: dict, product_info: dict):
    # Formats the data in order to match what is expected by the report
    data = []
    subtotals.pop("total")
    for district_id, district_values in subtotals.items():
        district_total = subtotals[district_id].pop("total")
        for product_id, product_values in district_values.items():
            new_data_line = {
                "district_name": district_info[district_id]["name"],
                "product_name": product_info[product_id]["name"],
                "district_code": district_info[district_id]["code"],
                "product_code": product_info[product_id]["code"],
                "product_total_r": product_values[CATEGORY_REGISTRATION],
                "product_total_a": product_values[CATEGORY_ASSEMBLY],
                "product_total_c": product_values[CATEGORY_CONTRIBUTION],
                "product_total_p": product_values[CATEGORY_PHOTO],
                "district_total_r": district_total[CATEGORY_REGISTRATION],
                "district_total_a": district_total[CATEGORY_ASSEMBLY],
                "district_total_c": district_total[CATEGORY_CONTRIBUTION],
                "district_total_p": district_total[CATEGORY_PHOTO],
            }
            data.append(new_data_line)
    data.sort(key=lambda x: (x["district_code"], x["product_code"]))
    return data


def payment_category_overview_query(user,
                                    date_start="2009-01-01",
                                    date_end="2099-12-31",
                                    requested_region_id=ALL_REGIONS,
                                    requested_district_id=ALL_DISTRICTS,
                                    requested_product_id=ALL_PRODUCTS,
                                    **kwargs):
    # /!\ Region is never displayed in the original report, only districts. There are totals per product, per district.

    # Checking the parameters received and returning an error if anything is wrong
    if date_start > date_end:
        return {"error": "Error - the start date cannot be greater than the end date"}
    product_id = int(requested_product_id)
    if product_id != ALL_PRODUCTS:
        product = Product.objects.filter(validity_to=None, id=product_id).first()
        if not product:
            return {"error": "Error - the requested product does not exist"}
    region_id = int(requested_region_id)
    if region_id != ALL_REGIONS:
        region = Location.objects.filter(validity_to=None, type='R', id=region_id).first()
        if not region:
            return {"error": "Error - the requested region does not exist"}
    district_id = int(requested_district_id)
    if district_id != ALL_DISTRICTS:
        district_filters = Q(validity_to__isnull=True) & Q(type="D") & Q(id=district_id)
        if region_id != ALL_REGIONS:  # The FE pickers allow you to select a district without a region, so additional steps are required
            district_filters &= Q(parent_id=region_id)
        district = Location.objects.filter(district_filters).first()
        if not district:
            return {"error": "Error - the requested district does not exist"}
        if region_id == ALL_REGIONS:  # The FE pickers allow you to select a district without a region, so additional steps are required
            region = district.parent
            region_id = region.id

    # Preparing data for the header table
    header = {
        "region": "All regions" if region_id == ALL_REGIONS else f"{region.code} - {region.name}",
        "district": "All districts" if district_id == ALL_DISTRICTS else f"{district.code} - {district.name}",
        "product": "All products" if product_id == ALL_PRODUCTS else f"{product.code} - {product.name}",
        "date_from": date_start,
        "date_to": date_end,
    }
    report_data = {
        "header": [header]
    }

    # Preparing reference data that will be used later
    product_info_mapping = prepare_product_info()
    district_info_mapping = prepare_district_info()
    total_family_members_in_policy = prepare_family_members_info()

    # Prepare the search criteria based on the received parameters
    search_filters = (Q(validity_to__isnull=True)
                      & Q(policy__validity_to__isnull=True)
                      & Q(policy__product__validity_to__isnull=True)
                      & Q(policy__family__validity_to__isnull=True)
                      & Q(pay_date__range=[date_start, date_end])
                      & ~Q(pay_type="F"))
    if product_id != ALL_PRODUCTS:
        search_filters &= Q(policy__product_id=product_id)
    if district_id != ALL_DISTRICTS:
        search_filters &= Q(policy__family__location__parent__parent_id=district_id)
    elif region_id != ALL_REGIONS:
        search_filters &= Q(policy__family__location__parent__parent__parent_id=region_id)

    subtotals = {
        "total": generate_subtotal()
    }
    # Photo fees are separated from the other premiums as they can be identified with the is_photo_fee field
    photo_fees = fetch_premiums(search_filters, is_photo_fee=True)
    for photo_fee in photo_fees:
        dispatch_subtotals(photo_fee["district_id"],
                           photo_fee["product_id"],
                           photo_fee["amount"],
                           subtotals,
                           CATEGORY_PHOTO)

    other_premiums = fetch_premiums(search_filters, is_photo_fee=False)
    for premium in other_premiums:
        # Other premiums cover 3 various payment categories
        split_premium_in_categories(premium, subtotals, product_info_mapping, total_family_members_in_policy)

    format_totals(subtotals, report_data)
    report_data["data"] = format_final_data(subtotals, district_info_mapping, product_info_mapping)
    return report_data


def fetch_premiums(search_filters: Q, is_photo_fee: bool):
    return Premium.objects.filter(search_filters, is_photo_fee=is_photo_fee) \
                          .values("policy_id",
                                  product_id=F("policy__product"),
                                  district_id=F("policy__family__location__parent__parent"),
                                  district_code=F("policy__family__location__parent__parent__code")) \
                          .annotate(amount=Sum("amount")) \
                          .order_by("district_code", "policy")


def prepare_family_members_info():
    # Prepares the number of members in each Policy and returns it in a dict[policy_id:total_members]
    total_family_members_in_policy = {}
    insuree_policies = InsureePolicy.objects.filter(validity_to__isnull=True) \
                                            .values("policy") \
                                            .annotate(members=Count("policy")) \
                                            .order_by()
    for ip in insuree_policies:
        total_family_members_in_policy[ip["policy"]] = ip["members"]
    return total_family_members_in_policy


def prepare_district_info():
    # Prepares the required District information and returns it in a dict[district_id:district_info]
    district_info_mapping = {}
    districts = Location.objects.filter(type="D") \
                                .values("id",
                                        "code",
                                        "name")
    for district in districts:
        district_info_mapping[district["id"]] = district
    return district_info_mapping


def prepare_product_info():
    # Prepares the required Product information and returns it in a dict[product_id:product_info]
    product_info_mapping = {}
    products = Product.objects.values("id",
                                      "code",
                                      "name",
                                      "registration_lump_sum",
                                      "registration_fee",
                                      assembly_lump_sum=F("general_assembly_lump_sum"),
                                      assembly_fee=F("general_assembly_fee"))
    for product in products:
        product_info_mapping[product["id"]] = product
    return product_info_mapping
