Hello there. I’m trying to export to pdf a table on Perspective via the Report Viewer. I use the same named query for the Table and the Report, but I would like to keep the order of the table as sorted by the user in the webpage for my pdf export. Is there any way to retrieve the sorting information? The columns.sort property does not seem to change when the user changes the sorting order
Welcome @matt_m, I don’t think this information is exposed in any way.
The only solution I can think of is to create you’re own sorting functions to manipulate the dataset into the correct order and then pass this to the report (either the dataset to display or the sort parameters).
Thanks @matthew.ayre!
My first temporary solution was actually letting the user sort the table via two dropdown menus (one for the column and the other one for descending/ascending) which allowed me to retrieve the sorting informations, but I found that sorting the table directly via the arrows on the table is much better in terms of user interaction.
I’m trying to pass the dataset directly to the report (as a tag) as you suggested and it seems to work!
Actually it doesn’t work
The dataset on the table component doesn’t seem to change when the user sorts it on the webpage, so the dataset I’m passing to the report it’s not sorted as I want
Hi @matt_m, I think all the table sorting is done client side, not server side. I would stick to the approach where you handle the sorting. You could disable the table headers and then use either buttons that look similar to the header (for a static number of columns), or buttons with a flex repeater (for a variable number of columns). It’s a fair bit more work, but you would be in control of the data then.
However, the caveat is that things like column resizing, etc. will be difficult.