2

I want a category of users can access some reports, view the results on the screen and print them to PDF. And to prevent any modification of the criteria, I want all the report configuration tabs to be hidden.

This is done by this users role having the permission “access CiviReport” enabled but the “access Report Criteria” one disabled.

But when disabling the “access Report Criteria” permission, the "Print report" and "Print to PDF" actions become inactive.

Is there any way to get what I want ?

Thanks for help.

3
  • 1
    This seems to be an issue in core. If Print report and Print to PDF action on the menu is not performing any task, it should be either fixed OR may be hidden from the menu item. Commented Jan 16, 2018 at 8:36
  • How can we ask the development team for a fix ? Commented Nov 11, 2018 at 23:43
  • You could start by filing an issue at lab.civicrm.org/dev/core/issues/new Commented Nov 12, 2018 at 2:58

1 Answer 1

2

This seems to be a bug in CiviCRM. Below patch will allow anonymous user to Print report or Print PDF.

diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php
index 75a614c836..9acd75c584 100644
--- a/CRM/Report/Form.php
+++ b/CRM/Report/Form.php
@@ -2580,7 +2571,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
     if (empty($this->_params) &&
       $this->_force
     ) {
-      $this->setParams($this->_formValues);
+      $this->setParams($this->_submitValues);
     }

     // hack to fix params when submitted from dashboard, CRM-8532
@@ -2588,7 +2579,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
     // in dashboard mode for report
     //@todo - this could be done in the dashboard no we have a setter
     if (empty($this->_params['fields']) && !$this->_noFields) {
-      $this->setParams($this->_formValues);
+      $this->setParams($this->_submitValues);
     }

Not sure what is the difference between formvalues and submitvalues even though params are considered from submit values for processing.

HTH

Pradeep

2
  • Can you mark it as answered and close the question? Commented Jan 17, 2018 at 3:11
  • Yes works, but not so good ! Many new troubles now : - get a "showBlocks array item not in .tpl = optionField_6" alarm when saving a report; - impossible to modify a report criteria; - when having two reports open in two browser tabs, if deleting one with the "delete" action, we get also the other one to be deleted with the "copy" action. Seems that old parameters are used, not the new actual ones. Commented Jan 17, 2018 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.