CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • New Custom Report
Pages: [1]

Author Topic: New Custom Report  (Read 1700 times)

srsr

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.4.2
  • CMS version: Joomla 1.5
  • MySQL version: 5.1.41
  • PHP version: 5.3.1
New Custom Report
June 20, 2011, 03:40:09 pm
I'm new in the use of the tool CiviCRM. I would the help of someone with urgency. I would like a report that shows the total amount of the contributions spent in a year by membership, this needs to bring a text to explain it.
Thanks in advance.

Seal

Rajan Mayekar

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 20
    • Rajan's Blogs
Re: New Custom Report
June 20, 2011, 08:52:34 pm
Hi,
You can take a look at Donor Report (Summary) OR Donor Report (Detail) with filter "Contribution Type = Member Dues" .
If these are not fit in your requirement then customizing 'Membership Report (Detail)'  may be the easy way :)
http://wiki.civicrm.org/confluence/display/CRMDOC32/CiviReport+structure+and+customization

Rajan

srsr

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.4.2
  • CMS version: Joomla 1.5
  • MySQL version: 5.1.41
  • PHP version: 5.3.1
Re: New Custom Report
June 21, 2011, 03:10:25 am
Thanks Rajan.
I already knew the Donor Report (Summary) and Donor Report (Detail).
But what I wanted was a donor/page and insert a fixed personalized text.

More or less this:

Name                                 Total
-------------------------------------------------------------------------
XXXXXXXXXXXXXXXXXXXX  $250

Comments:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Date: 99-99-9999



Rajan Mayekar

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 20
    • Rajan's Blogs
Re: New Custom Report
June 21, 2011, 03:23:42 am
This can be done by putting  this text in .tpl file of that report.
Eg:  for Donor Report (Detail), you can override template
templates/CRM/Report/Form/Contribute/Detail.tpl

Also you can access some smarty variables here.
Like, to display aggregate amount in above report you can use {$statistics.counts.amount}

Rajan

srsr

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.4.2
  • CMS version: Joomla 1.5
  • MySQL version: 5.1.41
  • PHP version: 5.3.1
Re: New Custom Report
June 21, 2011, 04:08:04 pm
Thank you, I think that really helps.
But my knowledge in PHP are a beginner. I have difficulties, but I'll try, for example the jump page for donor I do not see how.

srsr

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.4.2
  • CMS version: Joomla 1.5
  • MySQL version: 5.1.41
  • PHP version: 5.3.1
Re: New Custom Report
June 24, 2011, 01:57:40 pm
I´m still a beginer in PHP and CiviCRM, but i´m not still able to do the report.
If you or someone else could help me in this matter, i would be thankful.
I´ve tried to use the report  "Donation Summary Report (Repeat)" as teplate, because it has already everything i need, but i still need to split de information of the data base, each one by is own page.

Many thanks

Rajan Mayekar

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 20
    • Rajan's Blogs
Re: New Custom Report
June 24, 2011, 10:32:00 pm
Hey,
It would be easy to help, if you can specify your requirements in details and where your getting stuck while customizing the report.

Rajan

srsr

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.4.2
  • CMS version: Joomla 1.5
  • MySQL version: 5.1.41
  • PHP version: 5.3.1
Re: New Custom Report
June 25, 2011, 08:10:49 am
Quote from: Rajan Mayekar on June 24, 2011, 10:32:00 pm
Hey,
It would be easy to help, if you can specify your requirements in details and where your getting stuck while customizing the report.

Rajan

Thank you for your attention and patience!

Attached I send more details about what I need. If you have any doubts about any point I can try to clarify.

Many thanks

Rajan Mayekar

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 20
    • Rajan's Blogs
Re: New Custom Report
June 27, 2011, 09:13:36 pm
Basically u need to manipulate report result, you have $rows in .tpl file to display report result. Bydefault civireport uses table layout to display the result but u can change this accordingly by overriding .tpl file of that report.
Bellow is the example, to manipulate report result ( it will just display contact name ), same way u need to do this.
You can put
{debug}
at top of the .tpl file to debug all smarty variables, here you can find $rows values too.
Hope this will help you u to getting started.

Example Diff is as bellow OR u can take whole tpl code ( templates/CRM/Report/Form/Contribute/Repeat.tpl ) from http://pastebin.com/raTsAwk9
Code: [Select]
===================================================================
--- templates/CRM/Report/Form/Contribute/Repeat.tpl (revision 35001)
+++ templates/CRM/Report/Form/Contribute/Repeat.tpl (working copy)
@@ -23,4 +23,48 @@
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
 *}
-{include file="CRM/Report/Form.tpl"}
\ No newline at end of file
+    {if $section eq 1}
+    <div class="crm-block crm-content-block crm-report-layoutGraph-form-block">
+        {*include the graph*}
+        {include file="CRM/Report/Form/Layout/Graph.tpl"}
+    </div>
+    {elseif $section eq 2}
+    <div class="crm-block crm-content-block crm-report-layoutTable-form-block">
+        {*include the table layout*}
+        {include file="CRM/Report/Form/Layout/Table.tpl"}
+ </div>
+    {else}
+    <div class="crm-block crm-form-block crm-report-field-form-block">
+        {include file="CRM/Report/Form/Fields.tpl"}
+    </div>
+   
+    <div class="crm-block crm-content-block crm-report-form-block">
+        {*include actions*}
+        {include file="CRM/Report/Form/Actions.tpl"}
+
+        {*Statistics at the Top of the page*}
+        {include file="CRM/Report/Form/Statistics.tpl" top=true}
+   
+        {*include the graph*}
+        {include file="CRM/Report/Form/Layout/Graph.tpl"}
+   
+        {* include the table layout*}
+        {* Here u have $rows to maniputate result accordingly*}
+ <table>   
+ {foreach from=$rows item=row key=rowid}
+   {* eg: display contact name *}
+   <tr>
+            <td>
+            {ts}Contact Name:{/ts}{$row.contact_civireport_sort_name}
+            </td>
+          </tr>
+        {/foreach}
+        </table>
+    <br />
+
+        {*Statistics at the bottom of the page*}
+        {include file="CRM/Report/Form/Statistics.tpl" bottom=true}   
+   
+        {include file="CRM/Report/Form/ErrorMessage.tpl"}
+    </div>


Rajan

srsr

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.4.2
  • CMS version: Joomla 1.5
  • MySQL version: 5.1.41
  • PHP version: 5.3.1
Re: New Custom Report
June 28, 2011, 09:43:47 am
Rajan,
Many Thanks  :D

Jm

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • New Custom Report

This forum was archived on 2017-11-26.