DataExporter - Exclude Columns Particular columns can be excluded in exported document.
IdYearBrandColor
3d4f642a1990JaguarYellow
17d0a0a21961FiatYellow
287749291977HondaBrown
1d7cb8c72004MercedesSilver
00831f8c2002RenaultGreen
1048e6e61985VolkswagenRed
23ae57bf1984JaguarGreen
4a8012412003FordSilver
ce8e65601998HondaWhite
641bf82f2008RenaultWhite
<h:form>
    <p:dataTable id="tbl" var="car" value="#{dataExporterView.cars}" 
                 paginator="true" rows="10">
        <p:column>
            <f:facet name="header">
                <h:outputText value="Id" />
            </f:facet>
            <h:outputText value="#{car.id}" />
        </p:column>

        <p:column exportable="false">
            <f:facet name="header">
                <h:outputText value="Year" />
            </f:facet>
            <h:outputText value="#{car.year}" />
        </p:column>

        <p:column>
            <f:facet name="header">
                <h:outputText value="Brand" />
            </f:facet>
            <h:outputText value="#{car.brand}" />
        </p:column>

        <p:column exportable="false">
            <f:facet name="header">
                <h:outputText value="Color" />
            </f:facet>
            <h:outputText value="#{car.color}" />
        </p:column>
    </p:dataTable>

    <h:commandLink id="excel">
        <p:graphicImage name="/demo/images/excel.png" />
        <p:dataExporter type="xls" target="tbl" fileName="cars" />
    </h:commandLink>

    <h:commandLink id="pdf">
        <p:graphicImage name="/demo/images/pdf.png" />
        <p:dataExporter type="pdf" target="tbl" fileName="cars" />
    </h:commandLink>

    <h:commandLink id="csv">
        <p:graphicImage name="/demo/images/csv.png" />
        <p:dataExporter type="csv" target="tbl" fileName="cars" />
    </h:commandLink>

    <h:commandLink id="xml">
        <p:graphicImage name="/demo/images/xml.png" />
        <p:dataExporter type="xml" target="tbl" fileName="cars" />
    </h:commandLink>
</h:form>
                
PrimeTek, Copyright © 2017
All rights reserved.
Running PrimeFaces-6.2-SNAPSHOT on Mojarra-2.3.2.