Export huge dataset using dataExporter

UI Components for JSF
rafaelri
Posts: 17
Joined: 01 Mar 2010, 15:05

22 Mar 2010, 16:05

Hi all,

we were trying to export a p:dataTable (to Excel, XML,...) using p:dataExporter and a subclass of LazyDataModel that was dependent on a JBoss Seam EntityQuery instance. After spending some time trying to figure out why only headers were shown we decided to search the forum and to our surprise we found the following posts indicating that the combination we chose isn't supported:
http://primefaces.prime.com.tr/forum/vi ... 1000#p4463
http://primefaces.prime.com.tr/forum/vi ... 1015#p5612
Are there any plans on supporting exporting data tables with lazy loading data model? Are there any huge limitations on implementing it or it is just not a priority right now? If there isn't a huge reason for not doing it I am willing to help on this.
Is there any known workaround that won't end up on OutOfMemory errors?

regards,
Rafael Ribeiro

cagatay.civici
Prime
Posts: 17987
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

23 Mar 2010, 15:43

Hi Rafael,

In upcoming version, we'll improve lazy loading, right now I don't think it'll work as currently lazy data is available only in render phase whereas export request does not execute that. So after improvements this should work better.

What is your exact requirement here? When paging it should be lazy but when exporting do you need whole data?

rafaelri
Posts: 17
Joined: 01 Mar 2010, 15:05

23 Mar 2010, 16:12

cagatay.civici wrote:Hi Rafael,

In upcoming version, we'll improve lazy loading, right now I don't think it'll work as currently lazy data is available only in render phase whereas export request does not execute that. So after improvements this should work better.
Good to know... any ideas when it'll be released (only an estimate).
cagatay.civici wrote: What is your exact requirement here? When paging it should be lazy but when exporting do you need whole data?
Sincerely I am afraid that if I have a huge dataset and export it to PDF (the whole dataset export) I might end up with an OutOfMemory error on AppServer. That's why I thought that if the exporter was compatible with lazy loading and if it did not load the whole data during excel exporting but instead it iterated throught the resultset then it wont have any risk of throwing OutOfMemory errors.

cagatay.civici
Prime
Posts: 17987
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

24 Mar 2010, 18:50

Ok now I see.

Release date is beginning of april.

For lazy exporting, it is not supported now but if you create a ticket in our issue tracker, we can have a look at it. I'd really like to see this in PrimeFaces myself as well. DataExporter should be lazy aware so it can even export huge data.

So please create an issue and post the link here so we can have a look as time permits.


cagatay.civici
Prime
Posts: 17987
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

25 Mar 2010, 15:54

Seen that, thanks!

rafaelri
Posts: 17
Joined: 01 Mar 2010, 15:05

25 Mar 2010, 16:13

cagatay.civici wrote:Seen that, thanks!
Civici,

I have no idea how complex it is to implement this but if you are willing to guide someone on this I am willing to give a try. :)

cagatay.civici
Prime
Posts: 17987
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

25 Mar 2010, 16:17

You can play with one of the exporters like Excel Export;

The code is here;

http://code.google.com/p/primefaces/sou ... orter.java

Right now it iterates whole dataset, so if dataTable.isLazy() method returns true, it should iterate lazily using LazyDataModel.

Building PrimeFaces from source;

http://code.google.com/p/primefaces/wik ... FromSource

Just a pointer I can give for now, any contribution is appreciated :)

rafaelri
Posts: 17
Joined: 01 Mar 2010, 15:05

25 Mar 2010, 16:38

cagatay.civici wrote:You can play with one of the exporters like Excel Export;

The code is here;

http://code.google.com/p/primefaces/sou ... orter.java

Right now it iterates whole dataset, so if dataTable.isLazy() method returns true, it should iterate lazily using LazyDataModel.
So it is already different from V1.0?
cagatay.civici wrote:Building PrimeFaces from source;

http://code.google.com/p/primefaces/wik ... FromSource

Just a pointer I can give for now, any contribution is appreciated :)
I'll give a try and let you know here if I made any progress!

cagatay.civici
Prime
Posts: 17987
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

26 Mar 2010, 02:42

We haven't done any changes on dataExporter since 1.0 is out.

Any questions, just let us know. ;)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: mario.garcia and 15 guests