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….

Show HTML formatting in Oracle ADF

Quick Tip- If you have html content stored in database in string and you want to display same html formatting in ADF.

Use escape attribute in outputText’s escape attribute.You can also try outputFormatted also.In outputFormatted there is no escape property.

     <af:outputText value="&lt;h2>&lt;b>Techartifact&lt;/b>&lt;/h2>" id="ot1"
                         escape="false"/>
          <af:outputFormatted value="&lt;h2>&lt;b>Techartifact&lt;/b>&lt;/h2>" id="of1"/>

and output wil be like below

blog

Happy learning with Vinay Kumar in techartifact.