Closed mrrgithub closed 10 years ago
Hi there, i had the same error too and just came to a solution that seems to work so far. Actually there is a code block in the Exporter Source that will explicitly ignore the first RowExpansion content from DataTable or DataList. The method "org.primefaces.extensions.component.exporter.Exporter.exportCells(DataTable table, Sheet sheet)" contains the following code;
if ( table.getRowIndex() == 0 ) {
for (UIComponent component : table.getChildren()) {
if ( component instanceof RowExpansion ) {
RowExpansion rowExpansion = (RowExpansion)component;
if ( rowExpansion.getChildren() != null ) {
if ( rowExpansion.getChildren().get(0) instanceof DataTable ) {
DataTable childTable = (DataTable)rowExpansion.getChildren().get(0);
childTable.setRowIndex(-1);
}
if ( rowExpansion.getChildren().get(0) instanceof DataList ) {
DataList childList = (DataList)rowExpansion.getChildren().get(0);
childList.setRowIndex(-1);
}
}
}
}
}
table.setRowIndex(table.getRowIndex() + 1);
Commenting this out, results in the right output given by the exporter.
Thanks for reporting.It is fixed now.
Ok. Thanks for your support. Primefaces and PrimeFaces Extensions rocks!!!!
I'm exporting to pdf or excel the table used in showcase, exporter - expandable table and I notice that the information inside the p:rowexpansion changes between the html view and pdf or excel view. I notice that first item from datatable exports inside the data from the second item (it seems to mix up all data inside the p:rowexpansion on exported file). Thanks in advance.