2

i have a dataTable with filtered columns and using watermark to set input value and save some space in header, but when try to use dataExport the pdf file is rendered with some kind of reference from waterMark, like:

Column Title


org.primefaces.component.watermark.Watermark@46339a4c
The desired column content (...)

and the structure of my xhtml is basically:

    <h:form id="formID">

    <p:commandButton value="Export"ajax="false">
        <p:dataExporter type="pdf" fileName="file" preProcessor="#{my.stuff}" target="tableID" />
    </p:commandButton>

    <p:dataTable id="tableID" value="#{my.content}" var="myTable">
        <p:column id="columnID1" filterBy="#{myTable.Item}">
            <p:watermark value="Item" forElement="formID:tableID:columnID1" />
            <p:outputText value=#{myTable.Item}" />
        </p:column>
    </p:dataTable>

</h:form>

Thanks in advance and sorry for the bad english.

  • It is including everything inside of the column when building the report. You will either need to use the `excludeColumns` attribute to exclude the column with the watermark, or you will need to use the iText library to remove this offending text in the preProcess event. – maple_shaft Mar 01 '13 at 20:21
  • 2
    `dataExporter` use `toString()` method when exporting some components where is indeed `Watermark`. Use [this answer](http://stackoverflow.com/questions/14411389/pdataexporter-does-not-recognize-pcelleditor/14413932#14413932) just customize `exportValue` method. – partlov Mar 01 '13 at 21:43

0 Answers0