You need to sign in to do that
Don't have an account?
The new Learner
How to download an attachment on click
Hi Experts,
I have requirment i need download account related contact object records as pdf, i can able to make it as pdf, but , i want download once i click on that button,i am using this page as button source. can anyone help me.
I have requirment i need download account related contact object records as pdf, i can able to make it as pdf, but , i want download once i click on that button,i am using this page as button source. can anyone help me.
<apex:page readOnly="true" standardController="Account" applyHtmlTag="false" sidebar="false" showHeader="false" cache="true" renderAs="advanced_pdf"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <style type="text/css"> @page { size: A4 landscape; border: 2px solid black; padding-left: 8px; padding-right: 8px; } th { text-align: center; font-weight: bold; } td { text-align: center; font-size: 14px; } </style> </head> <center> <h3>Testing Advanced PDF = {!Account.Name}</h3> </center><br/><br/> <table border="1" width="99%"> <tr> <th>First Name</th> <th>Last Name</th> </tr> <apex:repeat value="{!Account.Contacts}" var="con"> <tr> <td>{!con.FirstName}</td> <td>{!con.LastName}</td> </tr> </apex:repeat> </table> </apex:page>
Have you tried checking the below documentation where there is an explanation to save as pdf functionality to vfpage:
> https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_output_pdf_print_as_pdf_button.htm
I hope this helps and in case if this comes handy can you please choose this as best answer so that it can be used by others in the future.
Below is the code referd in above documentation
THanks for the reply,
is this not possible once , i click on that button, instead of link on the same record page
can you tell me how to design below table for all fields.
one complete row one field, after that another field.