I am exporting data from a p:dataTable into an excel file, and i the data in one of the columns in formatted in a special way using < br > tags.
The problem is when i export the table, the < br > tags are printed into the excel document like this:
The code i am using right now:
<p:column sortBy="#{serviceLevel.titleAndDescription}">
<f:facet name="header">Description: </f:facet>
<h:outputText style="font-weight:bold" value="Title: <br />" escape = "false"/>
<h:outputText value="#{serviceLevel.title} <br /> <br />" escape = "false"/>
<h:outputText style="font-weight:bold" value="Description: <br />" escape = "false"/>
<h:outputText value="#{serviceLevel.description}" />
</p:column>
I have tried to use normal < br > tags between the outputText's which gave the same effect.
I have tried to use a < p:spacer > but the exporter doesn't support it :(
Any idea's on how i can keep the layout for the user, but not show the html tags in the exported excel document?
I am using Primefaces 3.5.
Thanks to SimonSez suggestion i managed to solve this issue with the help of some css.
Here is the solution i used:
<p:column sortBy="#{serviceLevel.titleAndDescription}">
<f:facet name="header">Description: </f:facet>
<h:outputText style="font-weight:bold; display: block;" value="Title: " />
<h:outputText style="display: block;" value="#{serviceLevel.title}" />
<h:outputText style="font-weight:bold; display: block; padding-top: 20px;" value="Description: " />
<h:outputText value="#{serviceLevel.description}" />
</p:column>