You need to sign in to do that
Don't have an account?
Ayush_Mangal
Exporting records in CSV through pagination using StandardSetController
I have pagination setup using StandardSetController. It is using dynamic query as it is based on seearch criteria.
I have set the page size as 50. (Lets name this page as Page1).
I am able to query 10000 records and show them using pagination. ( No problem till here.)
Problem lies when I want these records to be exported in csv format?
I have created another page (suppose Page2 ). I have a button on Page1 having action as
public PageReference toExcel(){ return page.Page2; }
On this page I am showing the records. Only 50 records are exported.
If I take 2 StandardSetController, say S1 and S2 and I query in S1 and put the result in S2 and then set the page size in S1, then also same thing is happening.
If I take 2 StandardSetController, say S1 and S2, and query differently, and put a limit of 5000, then it works fine, but then I have less no of records in query.
Any workaround?
I have set the page size as 50. (Lets name this page as Page1).
I am able to query 10000 records and show them using pagination. ( No problem till here.)
Problem lies when I want these records to be exported in csv format?
I have created another page (suppose Page2 ). I have a button on Page1 having action as
public PageReference toExcel(){ return page.Page2; }
On this page I am showing the records. Only 50 records are exported.
If I take 2 StandardSetController, say S1 and S2 and I query in S1 and put the result in S2 and then set the page size in S1, then also same thing is happening.
If I take 2 StandardSetController, say S1 and S2, and query differently, and put a limit of 5000, then it works fine, but then I have less no of records in query.
Any workaround?
Glyn Anderson
Sr Developer | System Analyst | ClosedWon | closedwon.com
Certified Developer | Certified Advanced Administrator
Blog: GlynATheApexGuy.blogspot.com
Twitter: @GlynAtClosedWon