List of Functions



All functions are mentioned below with defined tags, examples and data provided.


String Operations


Substr

Tag

{Key | substr:"start":"end"}

Data
{
   "eBooks":[
      {
         "book":"Pascal"
      },
      {
         "book":"Python"
      },
      {
         "book":"SQL"
      },
      {
         "book":"MYSQL"
      },
      {
         "book":"Ruby"
      }
   ]
}


Example
{#report}
 {#eBooks}
   {book | substr:"0":"2"}
 {/eBooks}
{/report} 


Replace

Tag

{Key | replace:"text":"replacewith"}

Data
{
   "eBooks":[
      {
         "book":"Pascal"
      },
      {
         "book":"Python"
      },
      {
         "book":"SQL"
      },
      {
         "book":"MYSQL"
      },
      {
         "book":"Ruby"
      }
   ]
}


Example
{#report}
   {#eBooks}
      {book | replace:"MYSQL":"MariaDB"}
   {/eBooks}
{/report}


Lower Case

Tag

{Key | lower}

Data
{
   "eBooks":[
      {
         "book":"Pascal"
      },
      {
         "book":"Python"
      },
      {
         "book":"SQL"
      },
      {
         "book":"MYSQL"
      },
      {
         "book":"Ruby"
      }
   ]
}


Example
{#report}
   {#eBooks} 
      {book | lower} 
   {/eBooks} 
{/report}


Upper Case

Tag

{Key | upper}

Data
{
   "eBooks":[
      {
         "book":"Pascal"
      },
      {
         "book":"Python"
      },
      {
         "book":"SQL"
      },
      {
         "book":"MYSQL"
      },
      {
         "book":"Ruby"
      }
   ]
}


Example
{#report}
   {#eBooks} 
      {book | upper} 
   {/eBooks}
{/report}


Simple Mathematical Funcations


Addition

Tag

{Key1 + Key2}

Data
 {
   "eBooks":[
      {
         "book":"Pascal",
         "LastYearIssuance":1,
         "CurrentYearIssuance":3
      },
      {
         "book":"Python",
         "LastYearIssuance":2,
         "CurrentYearIssuance":1
      },
      {
         "book":"SQL",
         "LastYearIssuance":4,
         "CurrentYearIssuance":5
      },
      {
         "book":"MYSQL",
         "LastYearIssuance":6,
         "CurrentYearIssuance":8
      },
      {
         "book":"Ruby",
         "LastYearIssuance":6,
         "CurrentYearIssuance":7
      }
   ]
} 
Example
{#report}
Book Last Year Issuance Current Year Issuance Total
{#eBooks}{book} {LastYearIssuance} {CurrentYearIssuance} {LastYearIssuance + CurrentYearIssuance}{/eBooks}
{eBooks | count:"LastYearIssuance"| toFixed:2}
{/report}



Subtraction

Tag

{Key1 - Key2}

Data
{
   "eBooks":[
      {
         "book":"Pascal",
         "LastYearIssuance":1,
         "CurrentYearIssuance":3
      },
      {
         "book":"Python",
         "LastYearIssuance":2,
         "CurrentYearIssuance":1
      },
      {
         "book":"SQL",
         "LastYearIssuance":4,
         "CurrentYearIssuance":5
      },
      {
         "book":"MYSQL",
         "LastYearIssuance":6,
         "CurrentYearIssuance":8
      },
      {
         "book":"Ruby",
         "LastYearIssuance":6,
         "CurrentYearIssuance":7
      }
   ]
}


Example
{#report}
{#eBooks}{book} {LastYearIssuance} {CurrentYearIssuance} {LastYearIssuance - CurrentYearIssuance} {/eBooks}
{eBooks | count:"LastYearIssuance"| toFixed:2}
{/report}


Multiplication

Tag

{Key1 * Key2}

Data
{
   "eBooks":[
      {
         "book":"Pascal",
         "LastYearIssuance":1,
         "CurrentYearIssuance":3
      },
      {
         "book":"Python",
         "LastYearIssuance":2,
         "CurrentYearIssuance":1
      },
      {
         "book":"SQL",
         "LastYearIssuance":4,
         "CurrentYearIssuance":5
      },
      {
         "book":"MYSQL",
         "LastYearIssuance":6,
         "CurrentYearIssuance":8
      },
      {
         "book":"Ruby",
         "LastYearIssuance":6,
         "CurrentYearIssuance":7
      }
   ]
}


Example
{#report}
Book Last Year Issuance Current Year Issuance
{#eBooks}{book} {LastYearIssuance} {CurrentYearIssuance} {LastYearIssuance * CurrentYearIssuance} {/eBooks}
{eBooks \ count:"LastYearIssuance"\ toFixed:2}
{/report}


Division

Tag

{Key / Key}

Data
{
   "eBooks":[
      {
         "book":"Pascal",
         "LastYearIssuance":1,
         "CurrentYearIssuance":3
      },
      {
         "book":"Python",
         "LastYearIssuance":2,
         "CurrentYearIssuance":1
      },
      {
         "book":"SQL",
         "LastYearIssuance":4,
         "CurrentYearIssuance":5
      },
      {
         "book":"MYSQL",
         "LastYearIssuance":6,
         "CurrentYearIssuance":8
      },
      {
         "book":"Ruby",
         "LastYearIssuance":6,
         "CurrentYearIssuance":7
      }
   ]
}
Example
{#report}
Book Last Yeat Issuance Current Year Issuance Total Issuance
{#eBooks}{book} {LastYearIssuance} {CurrentYearIssuance} {LastYearIssuance / CurrentYearIssuance} {/eBooks}
{eBooks | count:"LastYearIssuance" | toFixed:2}
{/report}


Aggregate Functions


Count Function

Tag

{Key | count:"Key" }

Data
{
   "eBooks":[
      {
         "book":"Pascal",
         "issuance":1
      },
      {
         "book":"Python",
         "issuance":2
      },
      {
         "book":"SQL",
         "issuance":4
      },
      {
         "book":"MYSQL",
         "issuance":6
      },
      {
         "book":"Ruby",
         "issuance":6
      }
   ]
}


Example
{#report}
Books  Issuance 
{#eBooks}{book} {issuance}{/eBooks}
{eBooks | count:"book"}
{/report}


Sum Function

Tag

{Key | sum:"Key" | toFixed:2}

Data
{
   "eBooks":[
      {
         "book":"Pascal",
         "issuance":1
      },
      {
         "book":"Python",
         "issuance":2
      },
      {
         "book":"SQL",
         "issuance":4
      },
      {
         "book":"MYSQL",
         "issuance":6
      },
      {
         "book":"Ruby",
         "issuance":6
      }
   ]
}


Example
{#report}
Books  Issuance 
{#eBooks}{book} {issuance}{/eBooks}
{eBooks | sum:"issuance" | toFixed:2}
{/report}


Avgerage Function

Tag

{Key | avg:"Key" | toFixed:2}

Data
{
   "eBooks":[
      {
         "book":"Pascal",
         "issuance":1
      },
      {
         "book":"Python",
         "issuance":2
      },
      {
         "book":"SQL",
         "issuance":4
      },
      {
         "book":"MYSQL",
         "issuance":6
      },
      {
         "book":"Ruby",
         "issuance":6
      }
   ]
}


Example
{#report}
Books Issuance
{#eBooks}{book} {issuance}{/eBooks}
{eBooks | avg:"issuance" | toFixed:2}
{/report}


Standard Deviation Function

Tag

{Key | stdev:"Key" | toFixed:2}

Data
{
   "eBooks":[
      {
         "book":"Pascal",
         "issuance":1
      },
      {
         "book":"Python",
         "issuance":2
      },
      {
         "book":"SQL",
         "issuance":4
      },
      {
         "book":"MYSQL",
         "issuance":6
      },
      {
         "book":"Ruby",
         "issuance":6
      }
   ]
}


Example
{#report}
Books Issuance
{#eBooks}{book} {issuance}{/eBooks}
{eBooks | stdev:"issuance" | toFixed:2}
{/report}


Minimum Function

Tag

{Key | min:"Key" | toFixed:2}

Data
{
   "eBooks":[
      {
         "book":"Pascal",
         "issuance":1
      },
      {
         "book":"Python",
         "issuance":2
      },
      {
         "book":"SQL",
         "issuance":4
      },
      {
         "book":"MYSQL",
         "issuance":6
      },
      {
         "book":"Ruby",
         "issuance":6
      }
   ]
}


Example
{#report}
Books  Issuance 
{#eBooks}{book} {issuance}{/eBooks}
{eBooks | min:"issuance" | toFixed:2}
{#report}


Maximum Function

Tag

{Key | max:"Key" | toFixed:2}

Data
{
   "eBooks":[
      {
         "book":"Pascal",
         "issuance":1
      },
      {
         "book":"Python",
         "issuance":2
      },
      {
         "book":"SQL",
         "issuance":4
      },
      {
         "book":"MYSQL",
         "issuance":6
      },
      {
         "book":"Ruby",
         "issuance":6
      }
   ]
}


Example
{#report}
Books  Issuance 
{#eBooks}{book} {issuance}{/eBooks}
{eBooks | max:"issuance" | toFixed:2}
{#report}


Filters or Conditions

Tag
{#**Tag** Name == "John"} , (+,-,&&,||,parentheses and ternary operator like a ? b : c are supported)
Data
{
   "eBooks":[
      {
         "book":"Pascal",
         "issuance":1
      },
      {
         "book":"Python",
         "issuance":2
      },
      {
         "book":"SQL",
         "issuance":4
      },
      {
         "book":"MYSQL",
         "issuance":6
      },
      {
         "book":"Ruby",
         "issuance":6
      }
   ]
}


Example
{#report} 
 {#eBooks}
  {#book == "Pascal"}
   {book} {issuance}
  {/book == "Pascal"}
 {/eBooks}
{/report} 


Conditional Page Break

Tag

{#Tag Name == "John"} {@`pageBreak} {/Tag Name == "John"}

Data

{
   "eBooks":[
      {
         "book":"Pascal",
         "issuance":1
      },
      {
         "book":"Python",
         "issuance":2
      },
      {
         "book":"SQL",
         "issuance":4
      },
      {
         "book":"MYSQL",
         "issuance":6
      },
      {
         "book":"Ruby",
         "issuance":6
      }
   ]
}


Example
 {#report} 
{#eBooks}
  {#book == "Pascal"}
   {`pageBreak}
  {/book == "Pascal"}
 {/eBooks}
{/report} 


Date Formatting

Tag

Done in Query

Data

"-"

Example

"-"


Graph Tag

MaxPrint uses chartjs library at backend for more examples please visit https://www.chartjs.org/docs/2.9.4/

Tag

{~Key}

Sql
select
json_object('chart' value 
    json_object(
        'height' value 400,
        'width' value 400,
        'chartdata' value json_object(
            'type' value 'pie',
            'data' value json_object(
                'datasets' value json_array(
                    json_object(
                        'label' value 'Department Wise Salaries',
                        'backgroundColor' value json_arrayagg(
                            'rgb('||to_char(floor(dbms_random.value(0,256)), '000')||','
                                  ||to_char(floor(dbms_random.value(0,256)), '000')||',' 
                                  ||to_char(floor(dbms_random.value(0,256)), '000')|| ')'
                        ),
                        'borderAlign' value 'center',
                        'borderColor' value '#fff',
                        'borderWidth' value 0.7,
                        'data' value json_arrayagg(sum(e.salary)),
                        'weight' value 1
                    )
                ),
                'labels' value json_arrayagg (
                    DEPARTMENT_NAME
                )),
            'options' value json_object(
                    'title' value json_object(
                        'display' value 'true',
                        'text' value 'Department Wise Salaries'
                    ),
                    'cutoutPercentage' value 0,
                    'rotation' value -1.570796326794895,
                    'circumference' value 6.28318530717958
                )

        )
    ) 
)result
from
    hr.employees e , hr.DEPARTMENTS d
where
      e.DEPARTMENT_ID = d.DEPARTMENT_ID
group by
    d.DEPARTMENT_NAME
Data
{
    "chart": {
        "height": 400,
        "width": 400,
        "chartdata": {
            "type": "pie",
            "data": {
                "datasets": [
                    {
                        "label": "Department Wise Salaries",
                        "backgroundColor": [
                            "rgb( 072, 034, 244)",
                            "rgb( 248, 036, 004)",
                            "rgb( 074, 246, 079)",
                            "rgb( 018, 234, 229)",
                            "rgb( 147, 167, 210)"
                        ],
                        "borderAlign": "center",
                        "borderColor": "#fff",
                        "borderWidth": 0.7,
                        "data": [
                            19000,
                            6500,
                            21400,
                            24900,
                            4400
                        ],
                        "weight": 1
                    }
                ],
                "labels": [
                    "Marketing",
                    "Human Resources",
                    "Shipping",
                    "Purchasing",
                    "Administration"
                ]
            },
            "options": {
                "title": {
                    "display": "true",
                    "text": "Department Wise Salaries"
                },
                "cutoutPercentage": 0,
                "rotation": -1.570796326794895,
                "circumference": 6.28318530717958
            }
        }
    }
}


Example
{#report}
    {~chart}
{/report}


Image Tag

Tag

{%Key | size="25,25"}

Data
{
   "eBooks":[
      {
         "book":"Python",
         "image":"iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFBUlEQVRo3u1ZbWxTZRR+zr29/V5Zt84uEGYQ0CUyoghRSERNNIyR8GHETWUxYgwxLkb9ocRo1AQ/YmJ0+JFpAkS+MmRA/MNYhCAfyTD6RxhhsHVmjA065j66ru3t/Tj+YB1lbF3v2q7+6Pl1+r7nvfc+73nec857CuQkJznJSTaF0vWgql0XvcSoZqBcZyzSmT0AhNFpnQh9IlELgGMA9tRvftD/vwCwYftZ0eJ0b1V0fl9WdLuiM8eey8xMRHfokkCwmISQJNJnqhz6ouH1ZVrWAKz7+hRZXJ79I1GtUtF0Q2slUYDDLNarkeBLh994lKf7DaZUAFhchVuCslql6syvrZhNa8sK8euFPt7RfGNSD8R0VWcKyuoLDqvjNIC6rACIqHqNNrp3a8sKYTYJWFfmwY7mG0mt1xiQVb0mawCiGpcyMwPAweY2fu6xBTh0rh2xsdhuJ9KjGkpT+YaUADBDJCIwM+/84ybVnbgCs9PNkt01JYVu62ORauYB3HEo7S5IdhfiNnlGJEUPJE+VyXTKNID135whq6tgCzNqNObSuOSEYVkzQJWJdQDQ/6zWYz8Y0InEVoC+C4SiP85auY+nnQfW154VzU733rCiVUVHw03s5al89HgAjUs+unuOJLBoqx8JaZvyVu7VpuUBszN/67CsVuozS+tRVyiAqlU6bY4WAJ8a9sDGn/72RnTqkFXdltFijIDGJR9PbiCYQxCs9wnLdvca8oBGQnVU0+0A7nB32ikUO8yT2bHiAEvVAL4yBCCqcflMMCVPDPKUwYiVcsMAdJ0XxUIdjwvuE41PV3/IfpmmttPKDB9ineEZT5V0U6hQ6MfznhOIp+nEa9hjGAADYmaiC+tuYUAtky6a1hWeofkFchK5jAXjACZx6XgKWUjBSutpfantvFZsGTQRmG7hj9+L2zoRyCyR5HYALjuNzSdDO6N5QCciMRGFLIJCNe6dWFF8XXBYSSQSppXIprJjZuOJTA0P90t2V1Ei9Kucp/ipudfJJN6K55mSwaDSbxhAZMDfarLleRJRqNx7gU1i6oXdVHZd/vAlwwACXZeO581Z+HgiCpU4A5RqRErGrsUXOG4YwPW/GvcXP7Jqq2AyWyddLDClsTMzMRNkLXzwRPd+wwCCPW2+zpP76uY988pbCdw9pmaKQrW/+Oou+IY6DAOQh25y58l92xxFJaXeh59enbFaKMHcoZPdjT80dGy76g/ztPtCosV+z5zl698seaKq0l5UMg+AEAPQtPSTTADQ2rpG/vm+oePAz0c7tw8F1d7UG1tEVjAXAbDG1hS4JPQ1rWlNB8+LKxpLewfk+MQXEQXc1HRE0nMnZo4A6Iof6g8oSBOFuHdAvnJXOZ9koy/rl/qsdiUmKjcS6ve+TPBWgG8cZeraPcb5rAFovzbSsXCuc2HSHvNWgAQzUFwBdO0GAPi6R3xZA1D/27WdH24u/TxZ+77WIyh8YAP+vXwEsSLrwPHuXVlrr88psrpq31lc/+yTs5O6fg4OK+gbisIzy4z8PAmHf+859u63LVUdPaFA1v7gmOUwed9+ccEH7226/1WrRbQlcx4ishb+cm/bjtoD7dv6A4o/ax4Y46FITm+Bpax6dcnG8uXe5Yvnuxbk50nuuKSnDQ4rA+d9gfamc/7mPY1XG/z98nlF5WDKbZk01152AC4AttHzFdcxhAogDCAAIISc5CQnOQGA/wDxuxbKn6/gRAAAAABJRU5ErkJggg=="
      }
   ]
}
 


Example
{#report} 
    Book Image 
        {#eBooks}
        {book} {%image| size="25,25"}
        {/eBooks}
{/report} 


Index Inside a Tag

Tag

{`index}

Data
{
  "eBooks": [
    {
      "book": "Pascal",
      "issuance": 1
    },
    {
      "book": "Python",
      "issuance": 2
    },
    {
      "book": "SQL",
      "issuance": 4
    },
    {
      "book": "MYSQL",
      "issuance": 6
    },
    {
      "book": "Ruby",
      "issuance": 6
    }
  ]
} 


Example
{#report} Index Books Issuance 
      {#eBooks}
         {`index} {book} {issuance}
      {/eBooks} 
{/report}


Line Break

Tag

"\n" in data will generate a new line automatically.

Data
{
   "eBooks":[
      {
         "book":"Pascal"
      },
      {
         "book":"Python **\n** Programming"
      },
      {
         "book":"SQL"
      },
      {
         "book":"MYSQL"
      },
      {
         "book":"Ruby"
      }
   ]
}


Null Value Example

Tag

A dash sign is used if null occurs

Data

"-"

Example

"-"

Number Formatting

To format numbers "numformat" tag can used, for e.g. you can transform numbers to any locale like in an example below a key/column named totalDues is transformed into pt-br (Portuguse-Brazil) locale.

Tag

{key | numformat:"$0,0.00":"pt-br"}

There are two parameters

1) Format => $0,0.00
     Formats are mentioned below under "Formats" Tag.

2) locale => pt-br

Sql Query
Select totalDues 
  from someTable 
Data
{
   "totalDues": 1000
}
Example



{#report}
         `{totalDues | numformat:"$0,0.00":"pt-br"}` 
{/report}
Formats
Numbers
Number Format Output
10000 '0,0.0000' 10,000.0000
10000.23 '0,0' 10,000
10000.23 '+0,0' +10,000
-10000 '0,0.0' -10,000.0
10000.1234 '0.000' 10000.123
100.1234 '00000' 00100
1000.1234 '000000,0' 001,000
10 '000.00' 010.00
10000.1234 '0[.]00000' 10000.12340
-10000 '(0,0.0000)' (10,000.0000)
-0.23 '.00' -.23
-0.23 '(.00)' (.23)
0.23 '0.00000' 0.23000
0.23 '0.0[0000]' 0.23
1230974 '0.0a' 1.2m
1460 '0 a' 1 k
-104000 '0a' -104k
1 '0o' 1st
100 '0o' 100th
Currency
Number Format Output
1000.234 '$0,0.00' $1,000.23
1000.2 '0,0[.]00 $' 1,000.20 $
1001 '$ 0,0[.]00' $ 1,001
-1000.234 '($0,0)' ($1,000)
-1000.234 '$0.00' -$1000.23
1230974 '($ 0.00 a)' $ 1.23 m
Bytes
Number Format Output
100 '0b' 100B
1024 '0b' 1KB
2048 '0 ib' 2 KiB
3072 '0.0 b' 3.1 KB
7884486213 '0.00b' 7.88GB
3467479682787 '0.000 ib' 3.154 TiB
Percentages
Number Format Output
1 '0%' 100%
0.974878234 '0.000%' 97.488%
-0.43 '0 %' -43 %
0.43 '(0.000 %)' 43.000 %
Time
Number Format Output
25 '00:00:00' 0:00:25
238 '00:00:00' 0:03:58
63846 '00:00:00' 17:44:06
Exponential
Number Format Output
1123456789 '0,0e+0' 1e+9
12398734.202 '0.00e+0' 1.24e+7
0.000123987 '0.000e+0' 1.240e-4


Page Break Except Last

Tag

{@`pageBreakExceptLast}

Data
 
{ "eBooks":[ { "book":"Pascal", "issuance":1 }, { "book":"Python", "issuance":2 }, { "book":"SQL", "issuance":4 }, { "book":"MYSQL", "issuance":6 }, { "book":"Ruby", "issuance":6 } ] }


Example
{#report} 
  Books Issuance 
    {#eBooks}
        {book} {issuance}
    {/eBooks} 
{/report}
{@`pageBreakExceptLast} 


Page Break

Tag

{@`pageBreak}

Data

{
   "eBooks":[
      {
         "book":"Pascal",
         "issuance":1
      },
      {
         "book":"Python",
         "issuance":2
      },
      {
         "book":"SQL",
         "issuance":4
      },
      {
         "book":"MYSQL",
         "issuance":6
      },
      {
         "book":"Ruby",
         "issuance":6
      }
   ]
}


Example
{#report}
   {#eBooks}
     {book} {issuance}
   {/eBooks} 
{/report}   
{@`pageBreak}


Qr Code Tag

Tag

{$Key}

Data

{"qrcode":"This is QRCode Data"}

Example
{#report}
  {$qrcode | size="50,50"}
{/report}


Rownum inside a Tag

Tag

{`rownum}

Data
{
   "eBooks":[
      {
         "book":"Pascal",
         "issuance":1
      },
      {
         "book":"Python",
         "issuance":2
      },
      {
         "book":"SQL",
         "issuance":4
      },
      {
         "book":"MYSQL",
         "issuance":6
      },
      {
         "book":"Ruby",
         "issuance":6
      }
   ]
}


Example
{#report}  
  {#eBooks}
    {`rownum} {book} {issuance}
  {/eBooks} 
{/report}