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
Victor EcheverríaVictor Echeverría 

Add line brakes inside a Case Text Output

I'm creating a visualforce page that renders as a PDF which uses various Case functions with only text outputs. I want the output to look organized and clean and for that I want to add line breaks inside that output.

Here's a snip of my code. I want a line brake after every sentence but when it renders it shows as a long paragraph without any breaks. Is there any way to do this?
<apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line">
          <tr>
             <td align="center">{!line.PricebookEntry.Name}</td>
             <td><br/>
             {!CASE(line.PricebookEntry.Name,
            "Tracx", "Acceso a una cuenta de Tracx. 
Set-up personalizado. 
Actividades ilimitadas.
Usuarios ilimitados.
Reportes descargables ilimitados.
Alertas ilimitadas.
Optimización de actividades.
Personalización de diccionarios.
Creación de usuarios con restricciones en base a solicitud del cliente.
Account Manager designado. 
Capacitación para el equipo que utilizará la herramienta.
Feedback e insights de valor.
Atención vía email, whatsapp y teléfono.",
            "TurboAds", "Acceso a una cuenta básica de Turbo
1 usuario.
Account Manager designado. 
Capacitación para el equipo que utilizará la herramienta.
Feedback e insights de valor.
Atención vía email, whatsapp y teléfono.
",
            "Shareablee", "Acceso a una cuenta básica de Shareablee de tu industria.
Account Manager designado. 
Capacitación para el equipo que utilizará la herramienta.
Feedback e insights de valor.
Atención vía email, whatsapp y teléfono.",
            "")}
         <br/><br/>   </td> 
             <td><apex:OutputField value="{!line.TotalPrice}"/></td>
          </tr>
       </apex:repeat>

 
VineetKumarVineetKumar
Isn't putting <br/> inside double quotes working?
Victor EcheverríaVictor Echeverría
Thank you for your response Vineet.
When I add "<br/>" at the end of each sentence it gives me the following error: Error: Syntax error. Found '>'. Not sure if I'm missing anything or if there is another method to accomplish what I'm trying to do
VineetKumarVineetKumar
Use it this way : Introduced a line break highlighted in bold.
<apex:outputText escape="false" value="{!CASE("Tracx",
            "Tracx", "Acceso a una cuenta de Tracx. 
Set-up personalizado. 
Actividades ilimitadas.</br>
Usuarios ilimitados.
Reportes descargables ilimitados.
Alertas ilimitadas.
Optimización de actividades.
Personalización de diccionarios.
Creación de usuarios con restricciones en base a solicitud del cliente.
Account Manager designado. 
Capacitación para el equipo que utilizará la herramienta.
Feedback e insights de valor.
Atención vía email, whatsapp y teléfono.",
            "TurboAds", "Acceso a una cuenta básica de Turbo
1 usuario.
Account Manager designado. 
Capacitación para el equipo que utilizará la herramienta.
Feedback e insights de valor.
Atención vía email, whatsapp y teléfono.
",
            "Shareablee", "Acceso a una cuenta básica de Shareablee de tu industria.
Account Manager designado. 
Capacitación para el equipo que utilizará la herramienta.
Feedback e insights de valor.
Atención vía email, whatsapp y teléfono.",
            "")}" />

Do mark my answer as best answer if it helped solve your problem.
Victor EcheverríaVictor Echeverría
Vineet,
 
I wrote the </br> as you posted but it only gets printed into the PDF Document. It seems that whatever is between " " only gets printed. Putting it with double quotes gives a syntax error.  This really shouldn't be that hard... I'm sure there is an easy way to accomplish these
VineetKumarVineetKumar
Ok, now I'm clueless as to what you meant.. :(
Victor EcheverríaVictor Echeverría
Sorry If I wasn't clear enough. I'll do my best to explain myself. 

The above code renders as a pdf document that we use for quotes. Each client can have several products and each product comes with it's own terms and conditions. I use a CASE to Identify what products the client wants and write in the quote the corresponding terms and conditions. The thing is I want the terms and conditions to appear in Bullet form:

-Term 1
-Term 2
-Term 3

But havent found a way to replicate the efect of <br/>  in the case output so it renders like this:

-Term1 -Term2 -Term3 

I hope this explanation helps you understand
VineetKumarVineetKumar
Please refer your working page here
Victor EcheverríaVictor Echeverría
<table border="0" width="95%" id="table4" class="special">
<tr>
       <td bgcolor="#C0C0C0"><font face="Arial">Categoria</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Entregables y Referencias</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Total</font></td>
</tr>
<tr>
<apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line">
          <tr>
             <td align="center">{!line.PricebookEntry.Name}</td>
             <td><br/>
             {!CASE(line.PricebookEntry.Name,
            "Tracx",
            "Acceso a una cuenta de Tracx.
Topics (por pais): 8.
Usuarios: 1.
Owned Medias: 2.
Capacitacion inicial: 1.
Cuentas con acompañamiento hacia ROI The Influence: 1.
Cuentas con QA The Influence: 1.
Setup inicial (incluye parametrización, dashoards, configuración de alertas y creación de usuarios con restricciones en base a solicitud del cliente).
Acccount Manager en Español dedicado.
Servicio por email y whatsapp."

,
            "TurboAds", "Acceso a una cuenta básica de Turbo
1 usuario.
Account Manager designado. 
Capacitación para el equipo que utilizará la herramienta.
Feedback e insights de valor.
Atención vía email, whatsapp y teléfono."
,
            "Shareablee", "Acceso a una cuenta básica de Shareablee de tu industria.
Account Manager designado. 
Capacitación para el equipo que utilizará la herramienta.
Feedback e insights de valor.
Atención vía email, whatsapp y teléfono.",
            "")}
         <br/><br/>   </td> 
             <td><apex:OutputField value="{!line.TotalPrice}"/></td>
          </tr>
       </apex:repeat>  
</tr>
<tr>
       <td bgcolor="#C0C0C0" align="right" colspan="6">
       <font face="Arial"><b>Sub Total (sin IVA):</b>&nbsp;<apex:OutputField value="{!Opportunity.Amount}"/></font></td>
</tr>


</table>

This is the entire piece of code that conserns me. The thing is that when it renders this is how it ends up

User-added image

I want all the text in the middle to appear in bullet form. One Sentence for each bullet. 
VineetKumarVineetKumar
I was able to do it the below way :
<apex:pageBlock >
            <apex:outputText escape="false" value="{!CASE("Tracx",
            "Tracx", "Acceso a una cuenta de Tracx.
                    Topics (por pais): 8. <br/>
                    Usuarios: 1.<br/> 
                    Owned Medias: 2.<br/> 
                    Capacitacion inicial: 1.<br/> 
                    Cuentas con acompañamiento hacia ROI The Influence: 1.<br/> 
                    Cuentas con QA The Influence: 1.<br/> 
                    Setup inicial (incluye parametrización, dashoards, configuración de alertas y creación de usuarios con restricciones en base a solicitud del cliente).<br/> 
                    Acccount Manager en Español dedicado.<br/> 
                    Servicio por email y whatsapp.",
            "TurboAds", "Acceso a una cuenta básica de Turbo 1 usuario.Account Manager designado. 
                        Capacitación para el equipo que utilizará la herramienta. Feedback e insights de valor.
                        Atención vía email, whatsapp y teléfono.",
            "Shareablee", "Acceso a una cuenta básica de Shareablee de tu industria. Account Manager designado. 
                           Capacitación para el equipo que utilizará la herramienta. Feedback e insights de valor. 
                           Atención vía email, whatsapp y teléfono.", "")}" />
        </apex:pageBlock>
Victor EcheverríaVictor Echeverría
Thanks for your help Vineet. This is what renders now:

User-added image

I'm not sure if <apex:pageBlock> doesn't work correctly when it is rendered as a PDF. It compiles just fine but form some reason it only prints this yellow line. Any ideas as to what could it be?
VineetKumarVineetKumar
Can you try by removing escape="false" from the output text tag, in your pdf page?
Victor EcheverríaVictor Echeverría
<apex:pageBlock >
            <apex:outputText value="{!CASE("Tracx",
            "Tracx", "Acceso a una cuenta de Tracx.
                    Topics (por pais): 8. <br/>
                    Usuarios: 1.<br/> 
                    Owned Medias: 2.<br/> 
                    Capacitacion inicial: 1.<br/> 
                    Cuentas con acompañamiento hacia ROI The Influence: 1.<br/> 
                    Cuentas con QA The Influence: 1.<br/> 
                    Setup inicial (incluye parametrización, dashoards, configuración de alertas y creación de usuarios con restricciones en base a solicitud del cliente).<br/> 
                    Acccount Manager en Español dedicado.<br/> 
                    Servicio por email y whatsapp.",
            "TurboAds", "Acceso a una cuenta básica de Turbo 1 usuario.Account Manager designado. 
                        Capacitación para el equipo que utilizará la herramienta. Feedback e insights de valor.
                        Atención vía email, whatsapp y teléfono.",
            "Shareablee", "Acceso a una cuenta básica de Shareablee de tu industria. Account Manager designado. 
                           Capacitación para el equipo que utilizará la herramienta. Feedback e insights de valor. 
                           Atención vía email, whatsapp y teléfono.", "")}" />
        </apex:pageBlock>

I removed escape="false" from the tag but still have the same output. The same yellow line continues to appear in the document. Is there anything I can put in the <apex:pageBlock> tag so it doesn't collapse?
VineetKumarVineetKumar
Can you share the whole page code here, and extensions/ custom controllers if any?