DataExporter - Exclude Columns

Particular columns can be excluded in exported document.

IdYearBrandColor
9f2718832009RenaultRed
21dc81be1977AudiYellow
0496b0061988BMWGreen
12c92c3b1968BMWRed
76ea8e371972FiatBlack
a3db08aa2009HondaBrown
b6d36bdc1985HondaOrange
940e38031997VolvoMaroon
1f1ca5821993AudiSilver
e9a0a8691964HondaOrange
<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>