Primefaces pdf generator multiple tables - jsf

I recently started using PrimeFaces dataExporter to generate pdfs. I am in need of not only inserting one of my data tables into the pdf but multiple. I am also in need of writing more information into the pdf.
I did research and it looks like there is still no implementation for multiple tables. Someone please confirm this. However, is it possible to write data to the pdf?
Thanks!

You cannot do this in the PrimeFaces dataExporter, but you can in the one that comes with PrimeFaces Extensions.
use this link
http://www.primefaces.org/showcase-ext/sections/exporter/multipleTables.jsf

Related

Tabulator - Download and re-use changes

I am new to Tabulator and started building my first project. While usage and setup is very intuitive and nicely built I struggle with one concept. I want to keep changes and entries I made to the table and load them again when re-opening the page.
My first thought was to download all entries as csv or xls and then import either from an array/JSON or from an HTML table. Is this the preferred way or is there another method I can use?
Thanks!
Note: I am using version 4.1
Tabulator doesn't include what you are looking for. However, you can use Tabulator to retrieve the table's values. As for saving and restoring the edited data, you may want to use your browser's localStorage: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage

DataTables export to excel

I'm currently working on a project (developed using laravel, php, javascript, jquery, html), containing a large amount of data, so I'm using DataTables to display them with serverside set to true. What I'm trying to figure out is how to export the complete table to an excel file - right now it only saves one page (the one being shown at that very moment ) - using the Button extention.
I've been reading about it for a while now but still can't figure out a way to do this. I understand that, since serverside is set to true,
the only rows that exist on the client-side are those shown in the table at any one time.
But how can I get the complete table? Any help would be appreciated!
UPDATE:
So I create the excel file with the data I want in the backend, using PHPExcel, but now the problem is that it is saved server-side, while I wanna make it downloadable (client-side). From what I've been reading, I must add the appropriate headers to do so, but nothing I've tried works. Using
this, I managed to output the data of the excel in the screen, but it just shows gibberish... I should probably also mention that I'm new at this!

PrimeFaces DataExporter for big data

I have 65000 data for getting from DB into excel.But PF DataExporter component is not writing big data into the excel.What can I use for this process?Is there a library for this process?
You can use:
Apache POI Some examples - Quick guide very easy to use and excellent simple examples
Jasper reports Just link - needs some time to figure it out
If you need just one excel export, use Apache POI.
If you have a lot of reports, i would recommend you to use Jasper reports because you can have option to export it to PDF, Excel, Word and other formats.
Good luck!

How to directly export a collection of DTOs to CSV, Excel or PDF?

I have a List<MyDto> which I want to export with PrimeFaces. I tried with <p:dataExporter>, but it seems that it only uses UI <p:dataTable> content.
How can I directly export a list of DTOs to CSV, Excel or PDF?
You need a library to handle this. Primefaces doesn't inherently know how to display your data (it analyzes the columns and then exports based on that) so you need to give it some hints. The short answer is that you can easily create a table either programatically via reflection on the DTO and binding it to the page or by creating a simple data-table and set it to a style of "display:none" and then using the exporter.
Alternatively you can look at a reporting suite like JasperReports that handles "printing" to the above formats, but again, you will need to do something to interpret it. If you don't care about performance JSON-Lib has a very nice "toXML" method that will rip down a DTO to xml which could then be easily exported to any of the formats you choose.
Basically, you're looking at ~ 1 hour of work if it is a complex set of DTOs or 10 minutes if it isn't--as long as bandwidth isn't an issue this should be completely painless.

Generating multiple sheets in a single excel document using Grails Export plugin

I'm using Export plugin for Grails(http://www.grails.org/plugin/export) to generate excel sheets. Now I need to create multiple sheets in the same Excel document and if possible, name those individual sheets. Searching around in internet, couldn't find any solution to this problem. Can someone please help on this?
thanks
There looks to be no way of doing this currently with that plugin.
Your best bet would be to add it as a feature request on the JIRA for that module -- or better yet -- take the module, add that functionality and submit a patch to the JIRA.
Or you're going to have to look for another way of exporting XLS data.

Resources