You need to sign in to do that
Don't have an account?
Rick Burmeister 5
Newbie: Apex code for moving to next line??
Very new to this. I have spent an hour on this and know you guys could answer this in 10 seconds. I am simply trying to get the "mailing Country" info to the next line. I have created an envelope button that is supposed to present info like this:
ABC Company
Attn:Accounts Receivable
New York, NY 12345
USA
But it incorrectly presents it like this:
ABC Company
Attn:Accounts Receivable
New York, NY 12345USA
How can I move the country info to the next line? Here is my code:
<apex:page standardController="Contact" renderAs="PDF" showheader="false" sidebar="false"> <apex:styleSheet value="{!URLFOR($Resource.Envelope)}" /> <apex:panelGrid columns="1"> <apex:outputField value="{!Contact.owner.name}"/> <apex:outputText value="{!$Organization.Name}"/> <apex:outputField value="{!Contact.owner.Street}"/> <apex:panelGroup > <apex:outputField value="{!Contact.owner.City}"/>, <apex:outputField value="{!Contact.owner.State}"/> <apex:outputField value="{!Contact.owner.PostalCode}"/> </apex:panelGroup> </apex:panelGrid> <apex:panelGrid columns="1" style="padding-left:300px; margin-top:100px;width:100%"> <apex:outputField value="{!Contact.account.name}"/> <apex:panelGroup > Attn: <apex:outputField value="{!Contact.name}"/> </apex:panelGroup> <apex:outputField value="{!Contact.mailingStreet}"/> <apex:panelGroup > <apex:outputField value="{!Contact.mailingCity}"/>, <apex:outputField value="{!Contact.mailingState}"/> <apex:outputField value="{!Contact.mailingPostalCode}"/> <apex:outputField value="{!Contact.mailingCountry}"/> </apex:panelGroup> </apex:panelGrid> </apex:page>
ABC Company
Attn:Accounts Receivable
New York, NY 12345
USA
But it incorrectly presents it like this:
ABC Company
Attn:Accounts Receivable
New York, NY 12345USA
How can I move the country info to the next line? Here is my code:
<apex:page standardController="Contact" renderAs="PDF" showheader="false" sidebar="false"> <apex:styleSheet value="{!URLFOR($Resource.Envelope)}" /> <apex:panelGrid columns="1"> <apex:outputField value="{!Contact.owner.name}"/> <apex:outputText value="{!$Organization.Name}"/> <apex:outputField value="{!Contact.owner.Street}"/> <apex:panelGroup > <apex:outputField value="{!Contact.owner.City}"/>, <apex:outputField value="{!Contact.owner.State}"/> <apex:outputField value="{!Contact.owner.PostalCode}"/> </apex:panelGroup> </apex:panelGrid> <apex:panelGrid columns="1" style="padding-left:300px; margin-top:100px;width:100%"> <apex:outputField value="{!Contact.account.name}"/> <apex:panelGroup > Attn: <apex:outputField value="{!Contact.name}"/> </apex:panelGroup> <apex:outputField value="{!Contact.mailingStreet}"/> <apex:panelGroup > <apex:outputField value="{!Contact.mailingCity}"/>, <apex:outputField value="{!Contact.mailingState}"/> <apex:outputField value="{!Contact.mailingPostalCode}"/> <apex:outputField value="{!Contact.mailingCountry}"/> </apex:panelGroup> </apex:panelGrid> </apex:page>
Did you try <br/> ?
All Answers
<apex:page standardController="Contact" renderAs="PDF" showheader="false" sidebar="false">
<apex:styleSheet value="{!URLFOR($Resource.Envelope)}" />
<apex:panelGrid columns="1">
<apex:outputField value="{!Contact.owner.name}"/>
<apex:outputText value="{!$Organization.Name}"/>
<apex:outputField value="{!Contact.owner.Street}"/>
<apex:panelGroup >
<apex:outputField value="{!Contact.owner.City}"/>,
<apex:outputField value="{!Contact.owner.State}"/>
<apex:outputField value="{!Contact.owner.PostalCode}"/>
</apex:panelGroup>
</apex:panelGrid>
<apex:panelGrid columns="1" style="padding-left:300px; margin-top:100px;width:100%">
<apex:outputField value="{!Contact.account.name}"/>
<apex:panelGroup >
Attn: <apex:outputField value="{!Contact.name}"/>
</apex:panelGroup>
<apex:outputField value="{!Contact.mailingStreet}"/>
<apex:panelGroup >
<apex:outputField value="{!Contact.mailingCity}"/>,
<apex:outputField value="{!Contact.mailingState}"/>
<apex:outputField value="{!Contact.mailingPostalCode}"/>
<apex:outputField value="{!Contact.mailingCountry}"/>
</apex:panelGroup>
</apex:panelGrid>
</apex:page>
Did you try <br/> ?