« ADF Faces RC: Strategies to find a popup component on a page to launch with a clientListener | Main | ADF Faces RC: Lucas Jellema about Date/Time input »
ADF Faces RC: How-to export table data to Excel?
By frank.nimphius | January 2, 2008
ADF Faces RC components provide a
Assume you have a table, a tree or a tree table created on the page for which you want to print its content. Add a button to the page to print the content. From the ADF Faces RC component palette, open the Operation tab and choose the "Export Collection Action Listener". Drag and drop this component on top of the command button.
![]() |
In the opened dialog, specify the component from which you want to read the data that should get printed. Note that this component must have a ID value defined, as well as any possible naming container (like panelCollection) surrounding it. You can use the edit button [...] on the dialog to browse the ADF Faces components on the page to assign values to the ID property. All components with an "*" at the end of the name will need to have an ID defined.
![]() |
After finishing the dialog, the ActionListener is setup as follows
-
<af:commandButton text="print table content">
-
<af:exportCollectionActionListener exportedId="panelCollection:departments"
-
type="excelHTML"
-
filename="Departments.xls"
-
title="Browse Departments"/>
-
</af:commandButton>
Note that "excelHTML" currently is the only allowed value for the type property. The value added to the "title" property shows in the Excel document as the worksheet name. The filename property defines the name of the file when downloaded to the client. Note that all of these properties can be set dynamically using Expession Language.
![]() |
Using a panelCollection surrounding the table allows the user to hide columns that he doesn't want to see in the print out. Important to notice though is that the
Frank
Topics: ADF Faces RC | No Comments »
Comments are closed.



