Detailed reports
Before using the functions on this page, you may find it useful to review the following information:
The list of all functions is here.
Description of this function |
|
---|---|
List of functions |
|
This section describes how you can retrieve data if you wanted to create a page that looks similar to the "Detailed reports" page (in the "Results" step) in Pathfinder. There are two calls to make:
The first call gets the "report tree" which is a hierarchical list of reports that could be used to create a tree as it appears on the left-hand menu of the "Detailed reports".
The second call allows the user to get the tabular data for that report.
Details on formatting the tables are also listed, below.
/service/getReportTree
function – Get Detailed Report List
The code sample below shows how to get the report tree.
function OnGetReportTree() {// Test 4
var guid = $('#scenarioguid').val();
OnGetJson('/service/getreporttree', {
scenarioGuid: guid
});
}
An abbreviated sample of what is returned is as follows.
{
"Items": [
{
"Items": [
{
"Items": [
{
"Items": [
{
"Items": [],
"Name": "Asset allocation $",
"Path": "Data\Actual value reports\INDL: Consolidated\Asset allocation\Asset allocation\Asset allocation $",
"Report": "-9223372002495035598",
"ReportName": "Client Asset allocation: Overall $",
"Expanded": false,
"Css": "page"
},
{
"Items": [
{
"Items": [],
"Name": "Outside super $",
"Path": "Data\Actual value reports\INDL: Consolidated\Asset allocation\Asset allocation\Outside super\Outside super $",
"Report": "-9223372002495035600",
"ReportName": "Client Asset allocation: Outside super $",
"Expanded": false,
"Css": "page"
}
],
"Name": "Outside super",
"Path": "Data\Actual value reports\INDL: Consolidated\Asset allocation\Asset allocation\Outside super",
"Report": "-9223372002495035602",
"ReportName": "Client Asset allocation: Outside super %",
"Expanded": false,
"Css": "page"
}
/service/getReport
function – Get Data for a Detailed report
To retrieve the data for any of the reports listed, specify the scenarioGuid
and reportpath
as follows.
function OnGetReport() {// Test 5
var guid = $('#scenarioguid').val();
var reportpath = $('#reportpath').val();
OnGetJson('/service/getreport', {
scenarioGuid: guid,
reportpath: reportpath
});
}
A sample of what is returned follows.
{
"Data": [
{
"ColNames": [
"",
"",
"2021/22",
"2022/23",
"2023/24",
"2024/25",
"2025/26",
"2026/27",
"2027/28",
"2028/29",
"2029/30",
"2030/31",
"2031/32",
"2032/33",
"2033/34",
"2034/35",
"2035/36",
"2036/37",
"2037/38",
"2038/39",
"2039/40",
"2040/41",
"Presentation"
],
"SectionName": "Asset Allocation: Overall (Excluding Family Home)",
"Data": [
[
"Asset class",
"",
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
"f:normal;s:h1"
],
[
"",
"Australian cash",
74882.8213849439,
120969.988868748,
169570.663013951,
60835.5256785991,
66706.0594727032,
73100.7977786853,
79934.8640777121,
86912.2282943745,
94454.3278813818,
104465.704672342,
110845.796268323,
Formatting detailed reports
When you use the /service/getReport
function, the data that is returned includes information that can help you format it in a user-friendly way.
Normal formatting
Data strings with normal formatting are usually dollar amounts, such as income and expenses on the cash flows report.
The suggested conventions for 'normal' formatting are:
No decimal places (if the data contains numbers)
Comma delimited (if numbers). It is quite common for 'normal' data be be in the thousands or millions.
A neutral font size and style
In the API output, this data is marked with "f:normal".
For example, in the ' Consolidated Cash flows' report (with Path: Data\Actual value reports\INDL: Consolidated\Cash flows). The 'Salary' data has 'normal' formatting (you can also check the 'Tax paid, annual expenditure rows, among others). This is how the output looks, and you can see it is marked as 'f:normal' on line 24:
[
"",
"Salary",
65000,
67112.5,
69293.65625,
71718.93421875,
74229.0969164063,
76827.1153084805,
79516.0643442773,
82299.126596327,
85179.5960271984,
88160.8818881504,
91246.5127542356,
94440.1407006339,
97745.5456251561,
101166.639722037,
104707.472112308,
108372.233636239,
112165.261813507,
116091.04597698,
120154.232586174,
124359.63072669,
"f:normal"
],
With the suggested formatting conventions, it would look like this:
65,000
67,113
69,294
71,719
74,229
76,827
79,516
82,299
85,180
88,161
91,247
94,440
97,746
101,167
104,707
108,372
112,165
116,091
120,154
124,360
Percentages (rate) formatting
Data strings with ‘rate' formatting should be formatted as percentages. If your 'normal' formatting rounds to full numbers, then it is important to format 'rate' lines differently so that they are not rounded to zero.
The suggested formatting for 'rate' is:
As a percentage with 2 decimal places and followed by the % symbol. e.g. display 0.105 as 10.5%
The same font size and style as 'normal' formatting
You can comma delimit the values, but it's highly unusual to have a percentage over 100%, so it's unlikely to apply
In the API output, this data is marked with "f:rate".
For example, in an individual's 'Super deposits summary' report (Path: Data\Actual value reports\INDL: NAME\Cash flows\Super deposits summary). The 'Super guarantee %' data has 'rate' formatting and an example of the output looks like this. You can see it is marked as 'f:rate' on line 24:
[
"",
"Super guarantee %",
0.105,
0.11,
0.115,
0.12,
0.12,
0.12,
0.12,
0.12,
0.12,
0.12,
0.12,
0.12,
0.12,
0.12,
0.12,
0.12,
0.12,
0.12,
0.12,
0.12,
"f:rate"
],
With the suggested formatting, it would look like this:
10.50%
11.00%
11.50%
12.00%
12.00%
12.00%
12.00%
12.00%
12.00%
12.00%
12.00%
12.00%
12.00%
12.00%
12.00%
12.00%
12.00%
12.00%
12.00%
12.00%
Age formatting
Data strings with 'age' formatting indicate the individual's age at the top of various reports.
The suggested conventions for 'age' formatting are:
One decimal place
The same font size and style as 'normal' formatting
In the API output, this data is marked with "f:age".
For example, in an individual's 'Cash flows' report (path: Data\Actual value reports\INDL: NAME\Cash flows (detailed). The 'Age at start of year' data has 'age' formatting, and you can see it is marked as 'f:age' on line 24:
[
"",
"Age at start of year",
27.3315068493151,
28.3306010928962,
29.3315068493151,
30.3315068493151,
31.3315068493151,
32.3306010928962,
33.3315068493151,
34.3315068493151,
35.3315068493151,
36.3306010928962,
37.3315068493151,
38.3315068493151,
39.3315068493151,
40.3306010928962,
41.3315068493151,
42.3315068493151,
43.3315068493151,
44.3306010928962,
45.3315068493151,
46.3315068493151,
"f:age"
],
With the recommended formatting, it will display like this:
27.3
28.3
29.3
30.3
31.3
32.3
33.3
34.3
35.3
36.3
37.3
38.3
39.3
40.3
41.3
42.3
43.3
44.3
45.3
46.3