|
ExportRecipes
How can I export my table data to a PDF, Excel, or CSV file?The best place to read about exporting data is found in the exports page or the export tutorial. How come my PDF export does not work?First make sure that you have your jmesa-pdf.css in a place where the PDF export can find it. The default location is in a folder called css at the top of the web directory. The global place to change this location is in the preferences. What you need to modify is the pdf.cssLocation preference. pdf.cssLocation=/css/jmesa-pdf.css Or you can set it directly in the API for each PDF export. if (tableFacade.getLimit().getExportType() == PDF) {
PdfView view = (PdfView)tableFacade.getView();
view.setCssLocation("/somefolder/jmesa-pdf.css");
}OK, but my PDF export still does not work?The flying saucer library (xhtmlrenderer) has this bad habit of trying to retrieve the CSS for the PDF by an URL connection. So this can produce many and funny different problems. I already fixed 2 and maybe found a third one soon:
How can I plug in my own export view?You can create your own view (extending AbstractExportView) and plug it in. if (tableModel.isExporting()) {
if (tableModel.getExportType().equals(ExportType.PDF)) {
tableModel.setView(new MyCustomView());
}
}
|