You need to sign in to do that
Don't have an account?
V Anand
How to set number of records to PDF page?
I am using renderas attribute for displaying records in PDF format like below format but some records are split into 2 pages in pdf .Now I want to set no.of records 5 to each PDF page .How can I do that.
any one help me please..........
Mr.Andy {Young
1301 Hoch Drive
Lawrence AndhraPradesh 66045
USA
Phone: (785) 241-6200
Mr.vissu
1301 Hoch Drive
Lawrence AndhraPradesh 66045
USA
Phone: (785) 241-6200
Let us say you have a list of Sobject
youneed to create a wrapper class
public class sobjectwrapper {
sobject sobj { get;set; }
Integer counter { get;set; }
}
Then once you have the list from soqlquery
loop through the list and create a list of sobjectwrapper with counter variable
use this class list in controller.
Please chat with me at vriavm@gmail.com if you need coding help...
All Answers
Hi,
You can use pagination for this. Please have a look in the blog, you can get a better idea.
Visualforce Page with Pagination
Thanks,
Aravind
Hi,
You can use StandardSetController which provides you to set no of pages.
Please check once it .so you will get a good idea to solve your problem.
Regads,
Sudhakar Reddy
Hi,
I was trying to explore into pagination with renderas PDF and i dont think we will have an option to achieve this. I just tried to show a list of records of a custom object in page as command link and clicking each record will take me to the detail page, but with the renderas PDF option the link doesnt work. And moreover, with this option a PDF with just 1 page (list of records) is getting created. I guess we dont have the option, please let the community know on your inputs/areas explored regarding this.
Thanks,
Aravind
Hi,
You can have a counter variable in the list you have and do a dynamic render of pagebreak in pdf based on the modulus operator like below:
<apex:outputpanel rendered="{!IF(AND(MOD(Counter,10) == 0), true, false)}">
<br/>
<DIV style="page-break-after: always"></DIV>
<br/>
</apex:outputpanel>
Let us say you have a list of Sobject
youneed to create a wrapper class
public class sobjectwrapper {
sobject sobj { get;set; }
Integer counter { get;set; }
}
Then once you have the list from soqlquery
loop through the list and create a list of sobjectwrapper with counter variable
use this class list in controller.
Please chat with me at vriavm@gmail.com if you need coding help...
Thank you so much ....
I have solved my problem with your valuable suggestion.....