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
Jha dilipJha dilip 

how can we do pagination in visualforce template

how can we do pagination in visualforce template like in footer we can have the page 1 of 1….
Best Answer chosen by Jha dilip
Amit Chaudhary 8Amit Chaudhary 8
Hi Dilip Jha,

Please check below post for Pagination i hope that will help you

Pagination using standardsetcontroller in salesforce
http://amitsalesforce.blogspot.in/2015/04/pagination-using-standardsetcontroller.html

Pagination with Wrapper Class ( with maintaing the state of selected records)
http://amitsalesforce.blogspot.in/2014/11/pagination-with-wrapper-class-with.html

Please let us know if this will help you

Thanks ,
Amit Chaudhary

All Answers

James LoghryJames Loghry
You could do this the same way pagination works with typical Visualforce.  The easiest way to setup pagination is to utilize the StandardSetController and it's prev/next methods.  Here's an article on how you could accomplish this with a Visualforce page: http://blog.jeffdouglas.com/2009/07/14/visualforce-page-with-pagination/ You should be able to do the same with your template.
Amit Chaudhary 8Amit Chaudhary 8
Hi Dilip Jha,

Please check below post for Pagination i hope that will help you

Pagination using standardsetcontroller in salesforce
http://amitsalesforce.blogspot.in/2015/04/pagination-using-standardsetcontroller.html

Pagination with Wrapper Class ( with maintaing the state of selected records)
http://amitsalesforce.blogspot.in/2014/11/pagination-with-wrapper-class-with.html

Please let us know if this will help you

Thanks ,
Amit Chaudhary
This was selected as the best answer
Jha dilipJha dilip
Hi All

Thanks for your response. please can you let me know can we do pagination in visualforce email template

Regards
Dilip
Jha dilipJha dilip
Hi All,

we can do pagination in visualforce template by following code and also putting header on diffrent pages

<style type="text/css" media="print,screen">
                @page {
                
                counter-increment:pages;
                @bottom-center{
                content: element(header);
                content: element(footer);
                
                }
                 
             }
                div.footer{
                            position :running(footer);
                          }
                        
                #pageNum:before
                          {
                    content: counter(page) "/" counter(pages);
                          }
                          
                div.header 
                {
                    padding: 10px;
                    position: running(header);
                }          
                          
                table {
                        border-collapse: collapse;
                        -fs-table-paginate: paginate;
                    
                            thead 
                                  {
                                    display:table-header-group;
                                  }
                    
                             tbody 
                                  {
                                    display:table-row-group;
                                  }
                
                }
          
        
                  
 
  </style>