Q:

How to export a data table as different from the UI in JSF Primefaces?

I have a data table which I want to export as different from the UI. 
For example, part of my data table is
<p:column sortBy="#{phi.patProtein}" width="130">
    <f:facet name="header">
        <h:outputText value="Pathogen Protein" />
    </f:facet>

    <h:outputText id="patProteinText" value="#{phi.patProtein}" />
    <p:commandLink id="patBtn" value="[+]" type="button" />
    <p:overlayPanel for="patBtn" hideEffect="fade" dynamic="true"">
        <h:outputText value="#{phi.patProteinLong}"/>
    </p:overlayPanel>
</p:column>

I want to export only the output text ("#{phi.patProtein}") from the column, not the command link ("[+]") and overlay panel. But Primefaces exports everything in column, and not gives me a chance to specify which fields of column to export. 
How can I do this?

A:

If you create two <p:column>s, one containing the <h:outputText> and the other one containing the <p:commandLink> and the <p:overlaypanel>, you can set the attribute "exportable" of the second column to false:
<p:column sortBy="#{phi.patProtein}" width="130">
    <f:facet name="header">
        <h:outputText value="Pathogen Protein" />    
    </f:facet>
    <h:outputText id="patProteinText" value="#{phi.patProtein}" />
</p:column>
<p:column exportable="false">   
    <p:commandLink id="patBtn" value="[+]" type="button" />
    <p:overlayPanel for="patBtn" hideEffect="fade" dynamic="true"">
       <h:outputText value="#{phi.patProteinLong}"/>
    </p:overlayPanel>
</p:column>

Then only the text should be exported.

