You need to sign in to do that
Don't have an account?
Text not outputing the way it should
Hi,
If for example a user enters the following into the Description field on an Events object:
Agenda Note 1
Agenda Note 2
Agenda Note 3
I have created a pdf with Visualforce and I want the Description field to output the data as shown above. However, it appears like this:
Agenda Note 1 Agenda Note 2 Agenda Note 3
Does anyone know how to get around this (if its possible at all)?
Here is my code:
<apex:pageBlock title="Meeting Information" mode="edit" > <apex:pageBlockTable title="Bi-Weekly Meetings" value="{!events}" var="e" columns="1" width="95%" > <apex:column> <b>Meeting Date</b><br />{!e.StartDateTime} (Duration: {!e.DurationInMinutes} minutes)<br /> <p><b>Meeting Agenda</b><br />{!e.Description}</p> <p><hr width="100%" /></p> </apex:column> </apex:pageBlockTable> </apex:pageBlock>
Thanks in advance
Warren
I have worked it out. You need to use the tag 'outputField'
works like a charm
All Answers
<apex:page Controller="test" renderAs="pdf">
<apex:pageBlock title="Account Information" mode="edit" >
<apex:pageBlockTable title="accounts" value="{!accounts}" var="a" columns="1" width="95%" >
<apex:column>
{!a.Name}<br />
{!a.Name}<br />
{!a.Name}
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
public class test
{
list<Account> lstAccount = new list<Account>();
public list<Account> getaccounts()
{
lstAccount = [select Name from Account ] ;
return lstAccount;
}
The text is all coming from one field so I would not be able to use the <br /> option.
User enters the text into a field like so:
Agenda Note 1
Agenda Note 2
Agenda Note 3
The output of the field appears like this:
Agenda Note 1 Agenda Note 2 Agenda Note 3
I cannot use <br /> as I do not know where the use has entered a carriage return.
Warren
I have worked it out. You need to use the tag 'outputField'
works like a charm