p:exporter issue with dynamic columns on row expansion

Community Driven Extensions Project
Post Reply
mineda
Posts: 4
Joined: 10 Jun 2014, 19:46

10 Jun 2014, 20:28

Hi,

I got the following code:

Code: Select all

        <p:dataTable emptyMessage="#{messages['empty.result.set']}" id="apontamentos" var="row" value="#{viewVariables.apontamentos}" rows="10" paginator="true" paginatorPosition="top" paginatorAlwaysVisible="false" rendered="#{viewVariables.apontamentos != null}">
            <p:column exportable="false" style="width:16px">
                <p:rowToggler />
            </p:column>
            <f:facet name="footer">
                <p:menuButton value="#{messages['export.action']}" rendered="#{not empty viewVariables.apontamentos}" ajax="false">
                    <p:menuitem value="#{messages['export.spreadsheet']}" ajax="false">
                        <pe:exporter type="xlsx" target="apontamentos" fileName="export" encoding="ISO-8859-1"/>
                    </p:menuitem>
                    <p:menuitem value="#{messages['export.pdf']}" ajax="false">
                        <pe:exporter type="pdf" target="apontamentos" fileName="export" encoding="ISO-8859-1"/>
                    </p:menuitem>
                </p:menuButton>
                <p:spacer width="10"/>
                <h:outputText value="#{fn:length(viewVariables.apontamentos)} #{messages['records.found']}" rendered="#{not empty viewVariables.apontamentos}"/>
            </f:facet>
            <p:rowExpansion>
                <p:dataTable emptyMessage="#{messages['empty.result.set']}" id="operacaoCargaVO_movimentacoesCarga" var="res" value="#{row.operacaoCargaVO.movimentacoesCarga}" rows="10">
                    <f:facet name="header">
                        <h:outputText id="header_propriedades" value="#{messages['propriedades']}"/>
                    </f:facet>
                    <p:columns value="#{res.qualidadesMovimentacao}" var="qua" columnIndexVar="colIndex">
                        <f:facet name="header">
                            <h:outputText value="#{qua.propriedade}" converter="com.arcadian.logOne.granel.domain.estoque.crud.PropriedadeJsfConverter"/>
                        </f:facet>
                        <h:outputText value="#{qua.valor}" />
                    </p:columns>
                </p:dataTable>            
            </p:rowExpansion>
            <p:column sortBy="#{row.operacaoCargaVO.inicio}">
                <f:facet name="header">
                    <h:outputText id="column_inicio" value="#{messages['inicio']}"/>
                </f:facet>
                <h:outputText id="operacaoCargaVO_inicio" value="#{row.operacaoCargaVO.inicio}" converter="sqlTimestampJsfConverter">
                </h:outputText>
            </p:column>
            <p:column sortBy="#{row.operacaoCargaVO.fim}">
                <f:facet name="header">
                    <h:outputText id="column_fim" value="#{messages['fim']}"/>
                </f:facet>
                <h:outputText id="operacaoCargaVO_fim" value="#{row.operacaoCargaVO.fim}" converter="sqlTimestampJsfConverter">
                </h:outputText>
            </p:column>
        </p:dataTable>
Table works perfectly on screen, but export is a mess. Data from last dynamic table of first page is associated with all records.
Screen: https://github.com/mineda/share/blob/ma ... edades.png
Export: https://github.com/mineda/share/blob/master/export.xlsx

Any tip?

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

13 Jun 2014, 15:30

I didn't get what issues you faced with export.Are you using latest 2.0.0 or older versions? Please look at the row Expansion showcase feature http://primefaces.org/showcase-ext/sect ... eTable.jsf
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

mineda
Posts: 4
Joined: 10 Jun 2014, 19:46

16 Jun 2014, 01:37

What I'm trying to do is a little unusual: the row expasion has a dynamic table inside it. This way each row can have a table with different number of columns inside the expansion.
I'm using an older version of primefaces extensions. Will try 2.0.0.
Sorry for my awful english.

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

16 Jun 2014, 07:00

I see.I never tried with dynamic columns inside rowExpansion feature.But it supports normal/plain datatable for sure.Please try with latest 2.0.0 release and let us know the result.

Compatible libraries: PF 5.0 and PFExt 2.0.0
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

mineda
Posts: 4
Joined: 10 Jun 2014, 19:46

25 Jun 2014, 05:45

Sorry for taking so much time to answer.
It does happen in version 2.0.0 (the way to implement it is different but the issue persists). :cry:

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

25 Jun 2014, 14:57

You can raise it as feature request in the issue trackerBut it might not be available soon considering busy schedules.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

mineda
Posts: 4
Joined: 10 Jun 2014, 19:46

26 Jun 2014, 02:37

Thanks for the reply sudheer. I will probably try a workaround (like using a normal table) instead.

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

26 Jun 2014, 05:32

mineda wrote:Thanks for the reply sudheer. I will probably try a workaround (like using a normal table) instead.
That is better.Or You can checkout the source code,add this feature and make a pull request :)
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 30 guests