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) »
  • Documentation for creating your own reports
Pages: [1]

Author Topic: Documentation for creating your own reports  (Read 1712 times)

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Documentation for creating your own reports
July 27, 2009, 08:25:03 am
Hi,
Not sure if this is the right board...maybe belongs under Developers, but I started on a document at http://wiki.civicrm.org/confluence/display/CRMDOC/CiviReport and if anyone who knows more about it wants to improve it that would be great.

One thing I wasn't able to figure out was how to get the same field name to appear more than once in the list of fields for the user to select, and I'm not sure if it's a limitation or if I just couldn't figure it out. For example suppose the report uses the contact table twice, e.g. to list a contact and their father in the same row, and you want both "display_name"'s to appear, one titled "Contact" and one titled "Father". It works in the output, but on the report generation page both fields appear with the same title. Snippet:

               'civicrm_contact' =>
                   array( 'dao'       => 'CRM_Contact_DAO_Contact',
                          'fields'    =>
                          array( 'display_name'           =>
                                 array( 'title' => ts('Contact'),
                                        'default'  => true, ),
                                ),
                        ),
               'father' =>
                   array( 'dao'       => 'CRM_Contact_DAO_Contact',
                          'fields'    =>
                          array( 'display_name'           =>
                                 array( 'title' => ts('Father'),
                                        'default'  => true, ),
                                ),
                        ),

Sunil

  • I post frequently
  • ***
  • Posts: 131
  • Karma: 23
  • The community around a product more important than the product itself?
    • CiviCRM
Re: Documentation for creating your own reports
July 29, 2009, 09:32:57 am
Hi,
We can use same fields name in more than one place

You can check following files

CRM/Report/Form/Contribute/SoftCredit.php
CRM/Report/Form/Contact/Relationship.php

Here we used display_name field

Sunil

The community around a product more important than the product itself?

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Documentation for creating your own reports
July 29, 2009, 10:52:15 pm
Thanks. I think the thing I was missing was the 'name' parameter, but I'm still slightly confused about the relationships between the parameters 'name', 'alias' and 'the key for the array', but I think mostly it's just "make it match with whatever else you are doing in the rest of the file".

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Documentation for creating your own reports

This forum was archived on 2017-11-26.