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
DBManagerDBManager 

Concatenation of Line Breaks in Text in PDF Visualforce Page

I am still relatively new to Visualforce and am trying to do something quite simple, but failing.

 

I am creating a PDF visualforce page for our contracts and I want the Terms and Conditions shown on the contract to vary, according to which value a user chooses from a picklist.

 

This is what I have so far:

 

{!IF(opportunity.Contract__c!='HPE2',
'1. Lorem ipsum dolor sit amet......' & '2. Sed accumsan dapibus dolor....' & '3. Integer ac urna quam....',
'1. Lorem ipsum dolor sit amet......' & '2. Sed accumsan dapibus dolor....' & '3. Integer ac urna quam....'
)}

 

What I cannot seem to do is to format the T&C's so that there is a line break between clauses. I have tried using the following:

 

& br() &

 But they do not work. Nor do any combination of <br/> or \n

 

So where I should have:

 

1. Lorem ipsum dolor sit amet.....
2. Sed accumsan dapibus dolor.....
3. Integer ac urna quam.....

 I currently get:

1. Lorem ipsum dolor sit amet.....2. Sed accumsan dapibus dolor.....3. Integer ac urna quam.....

 There must be a simple way of doing this?

 

Damien_Damien_

Is this what you have directly on the page?

 

try removing all of the 

 

' & '

 

and replacing them with

 

<br/>

DBManagerDBManager

Thanks Damien,

 

That doesn't seem to work - I get an error that says something like: 

Found '<'

 

I have managed to find a workaround - using a formula field to produce the formula text, then putting that field into the Visualforce page.

 

But I am still interested to hear if this is solvable.

 

Thanks again.

Damien_Damien_

Actually, you might be able to do what I told you to do with the <br/> but instead use \n

DBManagerDBManager

That doesn't work either, I'm afraid - just prints the \n as text.

 

Thanks anyway!