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
ChrisGountanisChrisGountanis 

Visualforce contenttype application/pdf Available?

Is there a way to export right to PDF using the below example found in the Visualforce documentation?
 
<apex:page standardController="Account" contenttype="application/pdf">
<apex:pageBlock title="Contacts">

<apex:pageBlockList value="{!account.Contacts}" var="contact">
<apex:column value="{!contact.Name}"/>
<apex:column value="{!contact.MailingCity}"/>
<apex:column value="{!contact.Phone}"/>
</apex:pageBlockList>
</apex:pageBlock>
</apex:page>
skhanskhan

You can use 'renderAs' instead of 'contentType'.

Code:
<apex:page standardController="Account" renderAs="pdf">
<apex:pageBlock title="Contacts">
<apex:pageBlockTable value="{!account.Contacts}" var="contact">
<apex:column value="{!contact.Name}"/>
<apex:column value="{!contact.MailingCity}"/>
<apex:column value="{!contact.Phone}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>


 

 

mtbclimbermtbclimber
FYI, that is only supported in Summer '08. If you are using prerelease or are on one of the sandbox environments that has been upgraded to the new release you can utilize this today. Other environments will be upgraded over the next 2 weeks.


ChrisGountanisChrisGountanis
How do you know what version your development sandbox is using? How do I upgrade to Summer 08?
TehNrdTehNrd

ChrisGountanis wrote:
How do you know what version your development sandbox is using? How do I upgrade to Summer 08?


Look near the salesforce.com logo. If there is a Kite it is spring 08, if it is a popsicle sherbet looking thing you are on Summer 08.

Summer upgrade schedule is here: http://trust.salesforce.com/trust/status/#maint
ChrisGountanisChrisGountanis
I am on Spring release that explains everything. Thanks for the inforamtion and I look forward to the PDF quote documentation that will be released soon. If there is anything I can do to get on Summer so I can prepare for our company please let me know.
mtbclimbermtbclimber
Here are a couple of samples that highlight pages2pdf:

http://wiki.apexdevnet.com/index.php/Visualforce_CaseHistoryTimeline

http://wiki.apexdevnet.com/index.php/Visualforce_Quote2PDF

Share and enjoy!
ChrisGountanisChrisGountanis
Thank you. Keep the examples coming. New technology with excited developers required working examples to expand on :)