Sunday, September 28, 2014

ADF: Export only Selected Rows from Table

Following post helps you to export only selected rows from ADF table.

We all know that af:exportCollectionActionListener operation allows to export rows from ADF table. by default it exports all the rows exists in the table.

Default af:exportCollectionActionListener usage:

  <af:commandButton text="Export Rows" id="cb1">
          <af:exportCollectionActionListener exportedId="t1"   -- t1 refers to ID for the ADF table
                                                               type="excelHTML"
                                                               filename="exportedRows.xls"/>
  </af:commandButton>

If you want to export the selected rows only from ADF table,  af:exportCollectionActionListener tag contains another attribute named exportedRows.

exportedRows --> valid values 'all' or 'selected'have to modify our above code as shown below.

  <af:commandButton text="Export Selected Rows" id="cb1">
          <af:exportCollectionActionListener exportedId="t1"
                                                               type="excelHTML"
                                                               filename="exportedRows.xls"
                                                               exportedRows="selected"/>
  </af:commandButton>

No comments:

Post a Comment

Provide your thoughts !