Since my outer DataTable
has only one column, and each row is a sub DataTable
I have extended the PDFExporter in this way:
@Override
protected String exportValue(FacesContext context, UIComponent component) {
if (component instanceof DataTable) {
DataTable tab = (DataTable) component;
try {
document.add(exportPDFTable(context, tab, false, false, "UTF-8"));
} catch (DocumentException ex) {
Logger.getLogger(ExtendedPDFExporter.class.getName()).log(Level.SEVERE, null, ex);
}
return "";
else {
return super.exportValue(context, component);
}
}
where document
is created by export
method.
The problem now is that each sub DataTable
uses dynamic columns, and for those columns in the exported PDF i got the values of the first sub DataTable
replicated in each sub DataTable
.
Any ideas for this?