function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Sort DataTable in Visualforce Page Rendered as PDF



I've created a Visualforce Page to generate PDF orders from a custom object (Orders).

In this page there are datatable merging data from Related list of Orders. 

When the pdf is generated those related lista are not in the same order as in the Order Detail Page.

I read that some Apex controller  need to be added to the page.

Can some one help me on this?



Stefano di Leone

David KingeryDavid Kingery

Find the query that populates your list and add "order by" to the end of it.

(select Id, Name, Location__c, City__c, State__c, Lateral__c, Port_Handoff_Speed__c from QR_Locations__r order by Name)


Craig RosenbaumCraig Rosenbaum
I'm facing this same issue. Can somebody explain where I would edit or put that SOQL query?