简体   繁体   中英

Data exporter in prime faces, when it generates the PDF, it shows tags rather tahn data

Here is my issue, I have the code below which lets me generate a PDF of the data table, instead the PDF it produces has output as the following:

"#{k.semester.semesterTerm}" "#{k.doubleValue}"
"#{k.semester.semesterTerm}" "#{k.doubleValue}"
"#{k.semester.semesterTerm}" "#{k.doubleValue}"
"#{k.semester.semesterTerm}" "#{k.doubleValue}"
"#{k.semester.semesterTerm}" "#{k.doubleValue}"
"#{k.semester.semesterTerm}" "#{k.doubleValue}"

My code:

                <p:dataTable id="surveyassess" value="#{studentoutcome.targetSurveyAssessment}" var="k"
                             selection="#{studentoutcome.selectedRow}" rowKey="#{k.id}" selectionMode="single" paginator="true" rows="10">

                    <p:ajax event="rowSelect" listener="#{studentoutcome.studentOutcomesSelect}"/>  

                    <p:column headerText="Semester">
                        <f:facet name="header">
                        </f:facet>
                        "#{k.semester.semesterTerm}"

                    </p:column>


                    <p:column headerText="Attainment Target">
                        <f:facet name="header">
                        </f:facet>
                        "#{k.doubleValue}"

                    </p:column>


                </p:dataTable>

                <p:panel header="Export Page Data">
                    <h:commandLink>
                        <p:graphicImage value="/icons/pdf.png" />
                        <p:dataExporter type="pdf" target="surveyassess" fileName="mypdf" pageOnly="true"/>
                    </h:commandLink>
                </p:panel>
            </h:form>
        </div>

Try using the h:outputText tag to display data in your columns, like:

<p:column headerText="Attainment Target">
                    <f:facet name="header">
                    </f:facet>
                    <h:outputText value="#{k.doubleValue}"/>
</p:column>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM