+ Start a Discussion
sobjectsobject 

Looking for VF pagination controls used by Reports

When you go to the "Reports" tab and create a custom report, then run the report - the report has pagination controls at the bottom - image buttons for first/next/prev/last and setting records/page.  Are these control available to VF developers to use programmatically?

 

(I would have attached a screen shot, but I see no way to do so here except to upload to another server and provide a link.)

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

I have blogged this here : http://forceguru.blogspot.com/2011/04/pagination-in-salesforce.html

 

Hope this will help.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

Ankit AroraAnkit Arora

I have blogged this here : http://forceguru.blogspot.com/2011/04/pagination-in-salesforce.html

 

Hope this will help.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer
sobjectsobject

Ankit,

 

That's the best solution I've seen so far, however, I forgot to mention, I need to be able to jump to a particular page of the results.  I tried using StandardSetController.setPageNumber(aPage) but it just reloads the first page.  This is very helpful, though - thanks!

sobjectsobject

Ankit,

 

Also, although your implementation is very helpful - my original question was that I was looking for the control that SFDC uses for their Reporting/views output, as shown in this screenshot:

 

 

 

 

After digging around, I can see this is probably a native javascript implementation i.e. there's a javascript class called "Paginator", as well as some CSS tricks to render the control images from a single image:

 

/img/paginationArrows.gif

 

common.css:

 

.paginator .firstoff{
    background-image:url(/img/paginationArrows.gif);
    background-repeat:no-repeat;
    background-position:0 -10px;
    width: 9px;
    height: 10px;
}

.paginator .prev{
    background-image:url(/img/paginationArrows.gif);
    background-repeat:no-repeat;
    background-position:-10px 1px;
    margin:0;
    padding:0;
    width: 9px;
    height: 10px;
}



...but more importantly, it has the ability to jump to a specific page number.  I don't know why SFDC forces developers to "roll their own" when they could just make this control available for Visualforce developers (unless VF is not feature-rich enough, in which case they resorted to native javascript)