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.
Hello!
First, thank you very much for the cool module. I like the way of implementing it as a display and configuring it like a view.
My use case requires that customers can filter the view before exporting it to a PDF. Therefore, I tried to solve it by putting an exposed filter on a PDF display, however it results in an empty page.....is it supported in this module or am I doing something wrong...?
Comments
Comment #1
semanthis CreditAttribution: semanthis commentedHi MF82
this is not nice but works for me: Create a default page from Your default view with identical exposed filter as the PDF-Page, then put some PHP-Code e.g. in the header to get the values of the active filters into an array (e.g with split('/', $_SERVER['REQUEST_URI']);). Then print a link to your PDF-view and pass the filter-values with that link. Hope that works for You...
Comment #2
SidneyGijzen CreditAttribution: SidneyGijzen commentedThanks for your reply semanthis! I will look into it :)
Comment #3
SidneyGijzen CreditAttribution: SidneyGijzen commentedHello semanthis,
I've been trying to figure out what you mean with your comment, but since I'm not a PHP hero, I'm having difficulties figuring out what you exactly trying to say. I understood the following:
My view should exist of three displays:
- default display with data
- PDF display
- page display; this contains the header with the PHP code. I assume the PDF display should be attached to this page in order to receive the filter strings. Am I correct in assuming that the PHP code manipulates the page URL in which I pass the filters?
I would appreciate it if you can elaborate a bit more on how this would work! :)
Comment #4
semanthis CreditAttribution: semanthis commentedSorry for the late answer, this is what I have done: I created a View added the filters, added a page-display and a pdf-display.
To figure out which values are choosen from exposed filters I did a
width a print_r you can find out what is in the array, then you can print the link to your pdf-display submitting the values from the exposed filters like this:
$path = base_path();
print $path."myview/pdf/".$qstrings[4]."/".$qstrings[5]; ">
print t("Als PDF exportieren");
The numbers behind $qstrings depend on the actual path of your view.
Hope that will help you, nice greetings from Sebastian
Comment #5
SidneyGijzen CreditAttribution: SidneyGijzen commentedThanks for your reply semanthis! I will check it out and let you know if I succeeded.
Comment #6
SidneyGijzen CreditAttribution: SidneyGijzen commentedhey semanthis,
Thanks again for your reply. It put me on the right track.
I already had the Print module installed with which I built a block with the same kind of PHP code you proposed. Exposed filters and printing/export pdf is unfortunately nowhere as integrated as we would like it to be :).
Anyway, my problem is solved, but not in the most elegant way... so I guess this could still remain as a "active / needs work" topic for the devs.
Comment #7
Simon Georges CreditAttribution: Simon Georges commentedMoving all feature requests to the current version of the module.
Comment #8
killua99 CreditAttribution: killua99 commentedDear fellow Drupal enthusiasts,
I have set this issue to "Postponed (Maintainer needs more information)".
If not already done please add an issue summary and steps how to reproduce the problem.
And please read again, "Making an issue report".
Help about how to do this can be found on IRC and in the user groups.
After there is new information, please re-open the issue by changing the status to active.
--
This issue was edited with the help of Issue Helper
Comment #9
killua99 CreditAttribution: killua99 commentedPlease open a new issue if you still have this problem.