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.
Question: Is it possible to set the export to landscape mode versus portrait? I'm happy to do the heavy lifting if I can be pointed in the right direction. Also, is it possible to set margins as well? I'd imagine this is possible through some modifications/additions to the CSS and head information views-data-export-doc-header.tpl.php template file.
This module is super handy, but unfortunately my tables extend a bit horizontally, hence the request. Thanks!
Comment | File | Size | Author |
---|---|---|---|
#3 | views_data_export-doc_formatting-1959640-3.patch | 4.32 KB | Anybody |
Comments
Comment #1
rickmanelius CreditAttribution: rickmanelius commentedComment #2
AnybodyThese links may help you:
http://sebsauvage.net/wiki/doku.php?id=word_document_generation
http://www.codeproject.com/Articles/7341/Dynamically-generate-a-MS-Word-...
http://stackoverflow.com/questions/13340216/html-generated-microsoft-wor...
I furthermore marked related issues.
I'll write a blog post about my solution (views-data-export-doc-header.tpl.php changes) on my blog http://Julian.Pustkuchen.com and post a link here for reference.
Comment #3
AnybodyFinally my blog post about .doc-document formatting for HTML documents exported to .doc can be found here: http://julian.pustkuchen.com/node/722
I've added my results as patch to this issue and I'd suggest to apply them to the project to provide a default formatting and easy & clean change of formats by overriding the header .tpl.php file from the module for individual changes.
For this specific issue you'd simply have to change
"mso-page-orientation: portrait;"
to landscape.Please let's discuss to add this default formatting to the great views_data_export.module.
Thanks a lot!
Comment #4
AnybodyPS: I'm using that template files in production, it works great and as expected.
Comment #5
AnybodyChanged the title of this issue to a more general one because it solves several related issues.
Comment #6
biarr CreditAttribution: biarr commentedThe patch is working. I'm also using it in production. Thanks
Comment #7
biarr CreditAttribution: biarr commentedChanging the status
Comment #8
schatzcoop CreditAttribution: schatzcoop as a volunteer commentedAttempting to apply this patch I get:
Even if I set to Unix line-endings...
Edit: I applied manually but found that there is an errant "\ No newline at end of file" on line 63. The changes below it are part of the same file, views-data-export-doc-header.tpl.php
Comment #9
MatthijsG CreditAttribution: MatthijsG as a volunteer commentedGet the same error as #8
Manually patching worked, don't added the two /-lines
Comment #10
fakir22 CreditAttribution: fakir22 commentedmso-page-orientation: landscape;
didn't worked for me so I simply inverted values for size parameter (changedsize: 21cm 29.7cm;
forsize: 29.7cm 21cm;
) and it seems to work ;)