Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With the help of the xls_serialization module views_data_export can write files for Excel.
With the patch in #2789531: Support for batch operations we have batch support.
But using both together results in garbled files because xls_serialization doesn't support batch writing.
Comment | File | Size | Author |
---|---|---|---|
#5 | 2945252-5.patch | 2.39 KB | tavib47 |
#3 | interdiff-batch_support_excel-2945252-3.patch | 1.38 KB | miiimooo |
Comments
Comment #2
miiimoooComment #3
miiimoooThis is my first shot at a rather brutal hack of this.
This requires first patching with the patch from #2789531-106: Support for batch operations
How to use: set your encoder to CSV and your output file name to something ending with xls(x)
Note, that instead of encoding on each batch run, this does the encoding as XLS at the end of the batch run. If that takes very long it could still hit some timeout.
Ultimately, the integration with the encoders needs changing for this to work in a more modular way.
Comment #4
riskogab CreditAttribution: riskogab commentedHi, I made some modifications in /src/Plugin/views/display/DataExport.php in processBatch function.
The XLS Serializer return the XLS file content what I save to a tempfile, and after it I merge the 2 XLS files.
Put this code after XML workaround:
and modify this line:
to this (elseif instead of if):
Comment #5
tavib47 CreditAttribution: tavib47 as a volunteer and at Eau de Web commentedHi,
I think riskogab's idea is better: we should manage xls output within processBatch method, as for XML.
Comment #6
vensires CreditAttribution: vensires at E-Sepia Web Innovation commentedNone of the patches is getting applied nowadays and from checking the code, it seems they are already implemented.
Could you please check and reopen if I'm missing a point here?