Forum Discussion
How to sort the drillthrough pages?
There is a way... but you aint gonna like it.
If you've report is saved in the .pbip format, there is a report.json file that contains alot of metadata about your report. Conversely, you can also fiddle with it in order bypass some quirks such as the drilldown order. By default, the drilldown order is determined by the order you create pages in as they are sequentially added to the pods array in the report.json file.
Here is how I solved the ordering in my drilldown to be alphabetical using some simple javascript:
1. In the reports.json file, copy the pages item into your browser dev console (quick and simple javascript context)
//contents of the sections item
pages = [
{
"config": "{\"visibility\":0}",
"displayName": "REPORT_PAGE_NAME",
"displayOption": 1,
"filters": "...",
"height": 1080.00,
"name": "1aa5971b6a505a00c014",
"ordinal": 12,
"visualContainers": [
...
],
"width": 1920.00
},
...
]2. In the reports.json file, copy the pods item into your browser dev console
//contents of the pods section in reports.json
pods = [
{
"boundSection": "b7242e0d2995d6d87cea",
"config": "{\"acceptsFilterContext\":1}",
"name": "c40213975ca4343c2258",
"referenceScope": 1
},
...
]3. Add the display name field to the respective pods and sort them
pods = pods.map((pod) => {
const page = pages.find(p => p.name == pod.boundSection)
pod.displayName = page ? page.displayName : null;
return pod;
}).sort((a, b) => {
return a.displayName.localeCompare(b.displayName)
})4. Copy the contents of the pods variable back into the pods item in report.json and viola. Done.
Alternatively, if you want custom ordering, then I'd suggest mapping the displayName to the pod anyway and then manually arranging in the reports.json file.