You need to sign in to do that
Don't have an account?
Jim Mottola
How can I sort list by field in a Visual force page using standard Opportunity Controller?
Muddling my way through my first visual force page; not a developer by trade. I've created a visual force button that will output the content of a related list to my opportunities (Visit Report) to a PDF file so that people can easily scroll through all VR's associated with an Opportunity & share with non-SF users. My code is listed below.
I have everything working as I like except the following 2 elements which I'm not sure how to handle (hoping for some help):
1) I want to sort the output Descending by the report date field
2) I want to make the headers of the table appear at the top of each page (repeating headers)
Can anybody help with this? It seems simple but I'm getting lost in the details.
I have everything working as I like except the following 2 elements which I'm not sure how to handle (hoping for some help):
1) I want to sort the output Descending by the report date field
2) I want to make the headers of the table appear at the top of each page (repeating headers)
Can anybody help with this? It seems simple but I'm getting lost in the details.
<apex:page standardController="Opportunity" renderAs="PDF"> <head> <style> @page { size:landscape;} .headerRow .TableTitle { background-color: #139cd8 !important; cellPadding="5";} body {font-family: 'Arial Unicode MS'; font-size:12px} </style></head> <apex:image id="logo1" url="/servlet/servlet.ImageServer?id=015i0000002XNDw&oid=00D630000009OtH&lastMod=1394633629000" width="25%" height="25%"/> <br/> <apex:pageBlock > <apex:pageBlockTable value="{!Opportunity.Visit_reports__r}" var="item" cellpadding="5" columnsWidth="5%,5%,5%,10%,65%" border="1"> <apex:column style="vertical-align:top; text-align:center" headerValue="Name" headerClass="TableTitle" value="{!item.Name}"/> <apex:column style="vertical-align:top; text-align:center" headerValue="Account" headerClass="TableTitle" value="{!item.Account__c}"/> <apex:column style="vertical-align:top; text-align:center" headerValue="Report Date" headerClass="TableTitle" value="{!item.Report_Date__c}"/> <apex:column style="vertical-align:top; text-align:left" headerValue="Purpose of Visit" headerClass="TableTitle" value="{!item.Purpose_of_Visit__c}"/> <apex:column style="vertical-align:top; text-align:left" headerValue="Visit Details" headerClass="TableTitle" value="{!item.Visit_Details__c}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>
The only way I know to do this is with a controller extension.
create a apex class like below , before saving validate all field name and query part,
modify your apex pages like below,
Hope this code will help you to fix your issue.
make it solved if its works for you.
Thanks
karthik
All Answers
The only way I know to do this is with a controller extension.
create a apex class like below , before saving validate all field name and query part,
modify your apex pages like below,
Hope this code will help you to fix your issue.
make it solved if its works for you.
Thanks
karthik
Check out these links take you to you exact requirements.
http://sivasfdcsolutions.blogspot.com.au/2012/09/pagenation-for-pdf-repeted-table-header.html
http://www.iterativelogic.com/visualforce-pdf-repeating-headers-and-footers/
thanks
karthik