To implement this, Drag and drop <af:exportCollectionActionListener> on 'Export to Excel' button. and specify exportedId="<search_results_table_id>" and type="excelHTML". Give fileName="excel_file_name.xls" and title="excel_sheet_name_within_excel_file".
The 'Export to Excel' toolbar button in 'Structure' window:
Here is the code:
<af:commandToolbarButton text="Export to Excel" id="commandToolbarButton2" disabled="#{bindings.EmpDeptVO.currentRow==null}" partialTriggers="t1"> <af:exportCollectionActionListener type="excelHTML" exportedId="t1" filename="SearchResults.xls" title="Search Results"/> </af:commandToolbarButton>
That's it. Now, when you run the page and click on 'Export to Excel' button, it'll generate the excel file and asks to open or save the Excel.
Enjoy!!
I'm using this one. One issue I observed with this is, I have a af:column with a af:inputText, af:commandButton & a popup inside it. Functionality is, when user clicks on commandButton, he sees he popup which has value as entered in the af:inputText.
ReplyDeleteWhen I export this table to an excel, I get to see duplicate values for this column. Somehow its assuming two values.
Thanks,
Bhargav.
Hi Bhargav,
ReplyDeleteYou can try having popup outside the table. You can still achieve the same required functionality with the popup outside the af:table. You can either invoke the popup using af:showPopupBehavior or programatically.
-Murali.
Hi,
ReplyDeleteI am using the above functionality and the file generated is html and MS Excel has trouble complaining its not a valid format. Can anything be done to troubleshoot this?
Thanks
Hi Murali,
ReplyDeleteWhile exporting the table (Search results), Framework doesn't write the search criteria that been entered to get the results.
Do we need to handle this through code for writing the search criteria to excel sheet ?
Regards,
Sai Yeluri.
@sai - Export to Excel only exports the search results into excel sheet. It won't export the search criteria.
ReplyDeletei am not getting the column names in the generated excel. Help!!!
ReplyDeletecolumn names i.e Header
DeleteHi Murali,
ReplyDeleteDo you know any way to export contents other than tables or trees into excel in ADF? In my case I need to add export functionality for Business Intelligence objects but I couldn't find any way to do so.
Hi,
ReplyDeleteThis is working fine , bt i want to check my rows are not empty. can u help me in this
20170303shizhong
ReplyDeletecoach outlet
fred perry
michael kors uk
coach outlet store online clearances
sac longchamp pas cher
michael kors outlet clearance
nmd adidas
kate spade outlet
polo ralph lauren
pandora charms sale
kobe 11
ReplyDeletemoncler
lebron shoes
curry shoes
yeezy 350
yeezy 500
yeezy
moncler
kyrie 7 shoes
golden goose sneakers
harbor freight titanium welder & forge tool
ReplyDeletei'ing and forge tool from our workshop to mine. titan metal 'ing and forge tool from our workshop to mine 'ing babyliss pro titanium flat iron and forge tool from our gaggia titanium workshop does titanium tarnish to mine. titanium alloy nier replicant
ww379 panama jack sunscreen baby,montecoutlet,autrystore,moonbootcanadasale,all star chile,zapatos melissa,alo yoga leggings,dc schuhe damen,dc shoes manteca fw108
ReplyDeletekc576 nfl shop,Cheap Jerseys china,Cheap Jerseys free shipping,wholesale nfl jerseys,Cheap Jerseys from china,wholesale jerseys,wholesale jerseys,Cheap Jerseys from china,Cheap Jerseys free shipping xq783
ReplyDelete