JARCH SHOWCASE
JARCH SHOWCASE
DataExporter - Customized Documents DataExporter provides easy customization options for the exported document using pre and post processors or ExcelOptions and PDFOptions objects.
IdYearBrandColor
fafa85071975HondaBlue
a33c8c951991MercedesSilver
c077f9ed2007MercedesWhite
993b423d1971FordGreen
56efda582007VolvoSilver
ed9e1ffd1982VolvoGreen
4bbe8efe1987AudiOrange
b4f826621965HondaBlack
77f9616f2006FordRed
93a405c01965AudiBrown
IdYearBrandColor
<a:form>
    <a:dataTable id="tbl" var="car" value="#{customizedDocumentsView.cars}"
                 paginator="true" rows="10">
        <a:column>
            <f:facet name="header">
                <h:outputText value="Id" />
            </f:facet>
            <h:outputText value="#{car.id}" />
        </a:column>

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

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

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

    <h:commandLink id="excel">
        <a:graphicImage name="/demo/images/excel.png" />
        <a:dataExporter type="xls" target="tbl" fileName="cars" postProcessor="#{customizedDocumentsView.postProcessXLS}" />
    </h:commandLink>

    <h:commandLink id="pdf">
        <a:graphicImage name="/demo/images/pdf.png" />
        <a:dataExporter type="pdf" target="tbl" fileName="cars" preProcessor="#{customizedDocumentsView.preProcessPDF}" />
    </h:commandLink>

    <a:dataTable id="tbl2" var="car" value="#{customizedDocumentsView.cars2}"
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {Exporters}"
                 paginator="true" rows="10" style="margin-top: 25px;">

        <f:facet name="{Exporters}">
            <div style="float:right">
                <h:commandLink>
                    <a:graphicImage name="/demo/images/excel.png" width="24"/>
                    <a:dataExporter type="xls" target="tbl2" fileName="cars" options="#{customizedDocumentsView.excelOpt}" />
                </h:commandLink>

                <h:commandLink>
                    <a:graphicImage name="/demo/images/pdf.png" width="24"/>
                    <a:dataExporter type="pdf" target="tbl2" fileName="cars" options="#{customizedDocumentsView.pdfOpt}" />
                </h:commandLink>
            </div>
        </f:facet>

        <a:column>
            <f:facet name="header">
                <h:outputText value="Id" />
            </f:facet>
            <h:outputText value="#{car.id}" />
        </a:column>

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

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

        <a:column>
            <f:facet name="header">
                <h:outputText value="Color" />
            </f:facet>
            <h:outputText value="#{car.color}" />
        </a:column>
    </a:dataTable>
</a:form>
                
JARCH, Copyright © 2022 All rights reserved. Running JARCH 24.3.0-SNAPSHOT on PrimeFaces-12.0.0 on Mojarra-2.3.13.