Help me to understand. I had to use dataExporter from org.primefaces 5.3 using the poi library. According to the idea, everything should work simply and perfectly, but in practice not everything is simple. I have a couple hundred thousand lines loaded into the dataTable . And it causes problems. On the table itself, I use pagination and a lazy list. The page is loaded by 50 lines, and when I click on a new page, I load the new 50 lines only from the 50th line to the hundredth. well and so on. Everything works perfectly. But when exporting, dataExporter calls the method that the dataTable'ом uses to load data, but passes parameters for loading 0 to it - this is from which row to load and the maximum value of the table is how many rows to load. And the maximum value is hundreds of thousands of lines. It turns out my heap is pulled out a bunch of rows and shoved into a sheet to export to Excel. And since the data dofiga server crashes with memory overflow. So the question is - how can you export data from dataTable primefaces to Excel, in parts and not at once?

  • one
    Directly on the server, create xls on the fly through the servlet, which is downloaded from the link. There it’s really quite easy to find a suitable option for downloading data. - Sergey
  • I'm already thinking about it, but I asked the question to make sure. Just so not comfortable a bit. form a report on the server and spit out the link? Can you somehow tie a filechooser to a thread? so that the user clicked download and pointed to where? - Pavel
  • one
    On the fly, this is when there is still no report, but there is a link. User clicks on it. Now a report is generated on the server and as it is formed, it is immediately unloaded to the user. Without any temporary / permanent files. The formation goes to the output stream servlet. On its side, the user can specify where to save the file or find it in the standard download folder in the usual way. - Sergey

0