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.
Is it possible to use PHPExcel classes inside 'Views data' module?
They schould really help in getting normal XLS and XLSX files...
Comments
Comment #1
Steven Jones CreditAttribution: Steven Jones commentedThis could be done as a standalone module, either in this codebase or in another project.
Comment #2
Johann Wagner CreditAttribution: Johann Wagner commentedPlease find attached a patch that adds support for the PHPExcel library.
I also added a views option to choose Excel format (XLS or XLSX).
Comment #3
Johann Wagner CreditAttribution: Johann Wagner commentedComment #4
Steven Jones CreditAttribution: Steven Jones commentedSee this FAQ page: https://www.drupal.org/node/1820458
Sorry but VDE core will not support 'proper' XLS files, but feel free to create a project on Drupal.org that provides the export format for VDE and I'll add a link from the project page.
Comment #5
d.novikov CreditAttribution: d.novikov commentedPlease take a look at this module, which I have just released. Do not know if it is properly designed, but it runs XLSX export for me:
https://www.drupal.org/project/views_data_export_phpexcel
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks d.novikov.
I have been using a different php excel library (php_excel based on libXl) for other excel generation on my site. I was able to use that module as a base to get it to work with it.
Comment #7
Huntelaer CreditAttribution: Huntelaer commentedI got error message:
Fatal error: Class 'PHPExcel' not found in sites/all/modules/contrib/views_data_export/theme/views_data_export.theme.inc on line 343
I resolved this by including the library path
Comment #10
annared CreditAttribution: annared commentedwhere did you include the library path?
Comment #11
apmsooner CreditAttribution: apmsooner commentedRevised patch in #7 to attempt to pass test.
Comment #12
apmsooner CreditAttribution: apmsooner commentedComment #15
apmsooner CreditAttribution: apmsooner commentedComment #16
apmsooner CreditAttribution: apmsooner commentedComment #17
kala4ekUpdated patch according to latest dev release.
Also fixed few issues related to code style.
Comment #20
kala4ekOops, wrong branch.
Reroll #17
Comment #21
ttournie CreditAttribution: ttournie commentedHi,
Thanks for the patch !
For me this patch was not 100% working (issues with bulk export and xlsx format). I have modified it a little bit.
the patch is done from the 7.x-3.0-beta9
Comment #22
ttournie CreditAttribution: ttournie commentedI have added the trim of new line for a cleaner display.
Comment #23
Pls CreditAttribution: Pls as a volunteer commented#22 patch works great with PHPExcel class library. Thank you!
Comment #24
joey91133 CreditAttribution: joey91133 as a volunteer and at Fliegen commentedPatch #22 is work without batch.
Comment #25
Dadaisme CreditAttribution: Dadaisme commentedHi!
I applied the patch #22 whit no error.
But the xls and xlsx files obtained are gibberish, they are not recognised as excel files. Any idea why?
Thx
Comment #26
cchoe1 CreditAttribution: cchoe1 commented@dadaisme
I haven't tested it out but I know PHPExcel has been deprecated as of Jan 2019. So even if this bug isn't a result of that, you should probably know that any future bugs related to the library probably won't be fixed. Should consider rewriting this patch using PHPSpreadsheet which is the successor to PHPExcel.
Comment #27
interdruper CreditAttribution: interdruper commentedFor D9 and PHPSpreadsheet library try https://www.drupal.org/project/views_data_export_phpspreadsheet