2

Keep getting message

Template not found. Could not find the report template. Make sure the report template is registered and/or url is correct.

I followed a guide in setting up a custom report. I created a new custom PHP path and a custom template path. Within both of those the guide said to recreate the path of the original report. ie: /CRM/Report/Form/Contact/then the .tpl placed in there. The path for custom PHP was also the same with the report PHP placed in there.

In the guide it said copy the existing tpl file (in this case it was called Relationships) and then edit it to include the following line:

 *}
{include file="CRM/Report/Form.tpl"}

It then said save it as the new file name. In this case ResidentialCommunities.tpl and refreshed

I then registered the report in Administer>Civireport> Register Report

In the settings under Url it shows /Contact/ResidentialCommunities Under Class it shows CRM_Report_Form_Contact_ResidentialCommunities

It registers. Then when going to Contact and Contact Reports then add new report it shows under Contact Reports the clickable link to my custom report. Then I click it and it throws the error. I'm certain that there is an issue with the Url field, but can't see why.

1 Answer 1

2

Not sure which one you used - but this is still one of the best guides out there:

https://alastaira.wordpress.com/2011/03/17/civicrm-creating-a-custom-report/

Note: the .php goes into your custom_php and your .tpl goes into your custom_templates (and you must set these paths in the Administer -> System Settings -> Directories: Cutom PHP Path Directory and Custom Templates).

After adding these paths and putting the .tpl and .php into place:

Clear caches: Adminster -> System Settings -> Cleanup Caches and Updates Paths - and hit the Cleanup Caches button.

4
  • Thanks for the info. Ive followed that tutorial to the letter, save for the filenames to suit my report. In this tutorial he dosnt put in a run once command and in other tutorials they suggest adding one. Anyways it is still throwing errors, so time for me to stick back to law and pay a professional to do it...i know when im outgunned. Many thanks Commented Jun 5, 2016 at 1:41
  • If you can post some screenshots - happy ro have another look at it. Commented Jun 5, 2016 at 2:16
  • Thanks karin but ive now fixed it. found some missing code. Commented Jun 5, 2016 at 13:32
  • Excellent! It's definitively not trivial to get into this - don't hesitate to post more Q if you think we can help out some more! Commented Jun 5, 2016 at 13:57

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.