Skip to main content
 have a VF page pulling a field set and displaying the data from the fields present in the field set.

 

In the below code the field set ‘Essay_Cover_Sheet’ contains a text area field named ‘Essay_Body__c’. Essay_Body__c has data with line breaks.

 

When the VF renders as PDF , I don’t see the line breaks, it directly appears as a single paragraphs

 

 

<apex:page standardController="TargetX_SRMb__Essay__c" showHeader="false" applyHtmlTag="false" applyBodyTag="false" standardStylesheets="false" renderAs="PDF">

<body>

<div>

<h2>Essay</h2>

<table width="100%" cellpadding="5px" cellspacing="5px">

<tbody>

<apex:repeat value="{!$ObjectType..FieldSets.Essay_Cover_Sheet}" var="field">

<tr>

<td><b>{!field.label}</b></td>

</tr>

<tr>

<td>{!TargetX_SRMb__Essay__c[field.fieldPath]}</td>

</tr>

</apex:repeat>

</tbody>

</table>

</div>

</body>

</apex:page>

 

 
1 Antwort
  1. 25. Aug. 2020, 21:56

    wrapping the field in an outputText with escape equal to false

    <apex:outputText value="{!TargetX_SRMb__Essay__c[field.fieldPath]}" escape="false"/>

     

     
0/9000