Problem DataExporter with Header

UI Components for JSF
Post Reply
rhohenfeld
Posts: 2
Joined: 29 Jan 2015, 21:25

30 Jan 2015, 16:29

Hi all,

DataExporter does not export correctly Header in PDF and XLS file format.
My library versions
- Primefaces 3.0.1
- Poi 3.7
- IText 2.1.7

I've tried with other versions without success. The following code snippet.

Code: Select all

DataExporter

<p:panel style="border:none;"> 
	<h:commandLink  style="margin-right:5px;">
	      	<p:graphicImage value="#{resource['images/icons/ico_excel.png']}" width="24"/>
	        <p:dataExporter type="xls" target="tb-agenda" fileName="name_fila" />
       </h:commandLink>
	<h:commandLink  style="margin-right:5px;">
        	<p:graphicImage value="#{resource['images/icons/ico_pdf.png']}" width="24"/>
               <p:dataExporter type="pdf" target="tb-agenda" fileName="name_file"  />
    	</h:commandLink>
</p:panel> 

DataTable

<p:dataTable id="table_id"
			value="#{Bean.method}"
			var="result" paginator="true" paginatorPosition="bottom"
			rows="10" paginatorAlwaysVisible="true"
			paginatorTemplate="{FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}">
			
			<p:column>
					<f:facet name="header">
						<h:outputText value="Columun Name" />
					</f:facet>
					<h:outputLabel value="#{result.parameter}" />
			</p:column>
<p:dataTable />								

The header is usually rendered in xhtml page. The error occurs when the export content of the header displays javax.faces.component.UIPanel@3b88ad.


Many thanks,
Rober

rhohenfeld
Posts: 2
Joined: 29 Jan 2015, 21:25

02 Feb 2015, 19:34

Hi all,

There are some incopatibilidade the use of these libraries in these versions?


Thanks

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

17 Feb 2015, 17:26

You should use h:outputText for dataExporter component because it recognize values from outputText only.

Next time please use Core forum any more questions.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 27 guests