Allow printing all views results

Created on 28 July 2022, over 2 years ago
Updated 10 July 2024, 4 months ago

Problem/Motivation

The entity_print_views submodule isn't configurable to print all results of a view instead of printing only the results showing on the current page.

Steps to reproduce

  1. Create a view that produces more than one result (say, 12 results.)
  2. Configure the view to use a pager displaying fewer rows than the total results from Step 1 above (say, 10 results)
  3. Add the Global 'Print' area to the header or footer
  4. Render the view, click on the 'Print' link and observe that the count of rows displayed is the number per page that you set in Step 2, not the total number of results

Proposed resolution

  1. Add a setting in SettingsForm to print all results from a view
  2. Update schema to include this new setting
  3. Update ViewPrintController to set 'items per page' to 0 (zero), which means to have no limit to the results per page
  4. Improve the project's README file to give clues as to how to hide the pager when the site is configured to print all results

Remaining tasks

Patch forthcoming. Will need test coverage.

User interface changes

New setting on SettingsForm.

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇺🇸United States COBadger

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Pipeline finished with Success
    9 months ago
    Total: 243s
    #111939
  • There is issue while applying patch, Raised the MR.

    Testing steps:
    1. Go to entity print config page: /admin/config/content/entityprint
    2. There 'll be new opt "Print all views results" , enabled it & save the form.
    3.Create a view that produces more than one result (say, 12 results.)
    4. Configure the view to use a pager displaying fewer rows than the total results from Step-1 above (say, 10 results)
    5. Add the Global 'Print' area to the header or footer
    6. Render the view, click on the 'Print' link and observe that Now all result of page 'll display

  • Pipeline finished with Success
    9 months ago
    Total: 225s
    #111960
  • Status changed to RTBC 9 months ago
  • 🇮🇳India shalini_jha

    I have tested this Merge Request (MR), and in the Entity Print module, there is an option called "Print all views results." Once I enable this option and click on "Print PDF," it works fine. +RTBC

  • 🇮🇳India Kanchan Bhogade

    Hi,
    I've tested MR !54 on Drupal 10
    Patch applied successfully.....

    Test Result:
    Added the "Print all views result" option and able to print all views.

    Added screenshots for reference

    RTBC++1

  • Status changed to Needs review 5 months ago
  • 🇺🇦Ukraine Znak

    Hi, everyone
    This patch is not working for version 2.13.0 because after applying this patch I had an error and I can't save changes with a selected checkbox. I created a new patch, please, test it

  • 🇺🇦Ukraine Znak

    Sorry, my mistake, the previous patch was wrong

  • 🇧🇷Brazil carolpettirossi Campinas - SP

    I'd like to suggest that the items should be processed in batches. If the views have lots of results, this could result in a max execution timeout.

  • I agree with @carolpettirossi. We are facing timeout issue of larger results.

Production build 0.71.5 2024