Export Few column to excel using propertyListener in ADF

If you want to export only few of the column of your table in ADF then follow this approach

inside exportCollectionListener use propertyListener like

<af:commandButton text="Export To excel" id="cb1">
            <af:setPropertyListener from="true"
                                    to="#{pageFlowScope.hideSomeColumns}"
                                    type="action"/>
            <af:exportCollectionActionListener exportedId="t1" type="excelHTML"
                                               title="Employee"
                                               filename="EmployeeData.xls"/>
            <af:setPropertyListener from="false"
                                    to="#{pageFlowScope.hideSomeColumns}"
                                    type="action"/>
          </af:commandButton>

 

and inside columns you can write an el in visible property as

]
<af:column sortProperty="#{bindings.Employees1.hints.LastName.name}"
                       sortable="false"
                       headerText="#{bindings.Employees1.hints.LastName.label}"
                       id="c7"
                       visible="#{pageFlowScope.hideSomeColumns ne true}">

  

Then only few columns will be exported.See the video

Download the sample application from here exportFewColumnExcel

Happy learning by Vinay Kumar in techartifact….

Vinay

I am an Oracle ACE in Oracle ADF/Webcenter. Sr Java Consultant-working on Java/J2EE/Oracle ADF/Webcenter Portal/ content and Hibernate for several years. I'm an active member of the OTN JDeveloper/Webcenter forum. Passionate about learning new technologies. I am here to share my knowledge. Give your views and suggestion on [email protected] .

More Posts - Website

Follow Me:
TwitterLinkedInGoogle PlusYouTube