Seal Report Forum
»
Report Edition
»
Reports
»
Sort Descending on the automatic Total column?
Rank: Advanced Member
Groups: Registered
Joined: 9/13/2018(UTC) Posts: 41 Location: Ottignies Was thanked: 2 time(s) in 2 post(s)
|
Hello,
I would like first to congratulate the team for SealReport, this product is amazing!
Once I get a clearer view over the product, I would be glad to contribute, for instance, I noticed that there is no object model published? that would help a lot when using scripts! Any input welcome. Or maybe a tooltip help, or an autocomplete (I will add these suggestions in the appropriate category).
For now, I have a specific question, I am trying to sort descending on the automatic Total column of my data table, but couldn't find an automatic way of doing it. Have I missing something, or is there a way using scripting to achieve this?
Thanks ! Thomas
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
Thank you for your feedback, If you want to contribute, please contact Ariacom at www.ariacom.com and we will have direct contact by email. Concerning the sort of the Total column, this option is not available... However you could for the sort of your final data table like this: Select your 'Data Table' view, then edit the 'Custom template' property to modify the line Where 9 is the column you want to be sorted (9 = column number 10 !) I will add a parameter in the 4.1 to control this... In attachment is my sample. Test sort total.srex (14kb) downloaded 2 time(s).
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/13/2018(UTC) Posts: 41 Location: Ottignies Was thanked: 2 time(s) in 2 post(s)
|
Thanks for the prompt reply!
I could get it working using the number of the last column as you mentionned : thanks !
I tried first to use order: [[ table.ColumnCount-1, "desc" ]], in order to always use the last column number, whatever the number of columns (as it can change in a CrossTab with drilldowns), but that doesn't work. the result table is then empty...
Thanks again Thomas
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
To make it dynamic, you have to set: Code:order: [[ @(table.ColumnCount -1), "desc" ]],
You are in JavaScript but user @ for Razor parsing first...
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/13/2018(UTC) Posts: 41 Location: Ottignies Was thanked: 2 time(s) in 2 post(s)
|
Brilliant!
Many thanks. Thomas
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/13/2018(UTC) Posts: 41 Location: Ottignies Was thanked: 2 time(s) in 2 post(s)
|
Hi,
I just tried to apply the same sort on the last column using the new parameter 'Data tables: Sort configuration', but I am not sure what to use there as syntax...
Will it work the same way as [ @(table.ColumnCount -1), 'desc' ] ?
That one doesn't seem to work...
Thanks for your help Thomas
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
For this you have to specify the index of the column...
This cannot be dynamic as the razor script is already compiled. [0,'asc'] indicates to sort the first column.
So this can be used if your number of columns is known...otherwise use the previous method...
|
|
|
|
Seal Report Forum
»
Report Edition
»
Reports
»
Sort Descending on the automatic Total column?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.