Data exporter does not handle html tags

jQuery UI Widgets
Post Reply
dalbert
Posts: 4
Joined: 07 Aug 2015, 16:42

20 Sep 2016, 19:50

The data exporter for .pdf and .xls does not handle html tags properly, at least for data table column headers. Depending on how the text containing the tags is generated, either no text is exported at all, or the text is exported containing the tags. I have not found a way to generate exportable text containing any font features (e.g. subscripts).

The (undocumented) workaround is to take advantage of what I believe is a bug (failure to emit any text in the export) and generate two sets of column headers; the headerText tag is emitted to the exported data table, so you can provide a headerText tag that does not include html and will generate proper exported headers. You can *also* use a header facet to generate stylized column headers for the UI:

<p:column headerText="P2O5">

<f:facet name="header">

<p:outputLabel value="P" />
<h:outputText style="font-variant-position: sub" value="2"/>
<h:outputText value="O" />
<h:outputText style="font-variant-position: sub" value="5"/>

</f:facet>

</p:column>

This seems like an ugly hack and there really should be a better answer, but this approach at least offers a work-around.

Post Reply

Return to “PrimeUI”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests