I think too that this would be a good thing to be able to export rich datatable (in Excel, PDF, ...).
I know that I can do it by myself (and this is what I've done usnig http://wiki.apache.org/myfaces/Exporting_DataTable_To_MS-Excel),but before using JSF I used displaytag and it was so easy to export the data table ! I was really surprised when I noticed that it wasn't possible with richfaces (and with most of the JSF components librairies).
Will this functionnality be planned in a future version ?
Hi toomtooms, I have faced the same problem for a few days and have found one Open Source possibility for doing this.
This is the Link to the component:
Another URL - with a litte bit description regarding this topic:
Personally I haven't tried this, because I wanted an XLS, with a lot more data and other structuring and therefore I have implemented my own solution.
Based on jXLS http://jxls.sourceforge.net/
But maybe you or rajevar will give the jsf-comp a try and post your experience in this post?
Thank you for your answer, I will try the jsf-comp component.
Until now here are the ways I tried :
1 - http://wiki.apache.org/myfaces/Exporting_DataTable_To_MS-Excel
This solution works very fine if you don't use pagnation. Indeed, this exports only what is displayed. So, filtering and sorting are taken in count. But if you use pagination, it only exports thecurrent page.
2 - PrimeFaces Optimus exportActionListener component (http://www.rehberharitam.com/primefaces-examples/optimus/exporter.jsf)
This component works fine, even with pagination. The only issue is when using external filtering. External filtering (filterMethod attribute) is not taken in count, and of course my rich:datatable has an external filtering :(
Where can I suggest to add this feature natively in a future version of RichFaces ? In JIRA ?
My JSF application doesn't use Seam or Facelet at all. Do I have to make a lot of changes to integrate the Seam's Excel Export component ?
I've added jboss-seam-excel.jar and jxl.jar in my WEB-INF/lib but I have the following error :
The function export must be used with a prefix when a default namespace is not specified
Do I have to change my web.xml and add a components.xml file, as mentionned in http://www.seamframework.org/Community/RichdatatableToExcelExportIsEasyButIGetError ?
You should use seam instructions. RF not influence on such seam features and settings anyhow.
I just want to share what I finally done :
I did a mistake, PrimeFaces works fine with external filters. There was still a little problem : it doesn't export headers from a rich:columnGroup.
So I've downloaded the excelExporter component from the MyFaces sandbox and adapted it to my need (to export headers from a rich:columnGroup for example), and it works very fine !
But it would be so cool to add this feature natively in the rich:datatable component !
Thank you for your help.
I needed also this functionality so I took the primefaces dataExporter component and modified it to use it with Richfaces. I also added the capability to export collapsibleSubTable insides tables.
Primefaces and Richfaces are opensource, feel free to improve it.
Package containing sources and examples:
I agree, but I didn't find your component when I searched a component to export data with richfaces, too late. I'm a bit angry against myself ! I think it's because access to Github is blocked in my company ... stupid security policy.
It need more advertisement.
I don't see on the Github if it exports also collapsibleSubTables inside datatables ? Does it ?
Here at My company also is all locked, yet there is no support for collapisbleSubTable, but I think something is not very difficult to implement, when I downloaded the code from github, did not support extended DataTable, and I even implemented this feature was simple and fast.
I think it's already at the time of RichFaces provide these types of features, I see many new projects changing richfaces to primefaces components because these utilities.
Yes, clearly. In my company architects decide to choose Richfaces instead of Primefaces because they choose JBoss EAP with support option, and so they are more confident to use JBoss components for the full stack, and also because RedHat is a big boss in Java world. But the lack of components of Richfaces compare to Primefaces nearly changed the decision. And in a previous company, where we have the choice, we choose at project start to use Primefaces just after we compare their showcases, so much we were impressed by the diversity of components and features of Primefaces. It's strange Richfaces keeps being outrunned so much.