Reporting

brononius 26 Jun, 2013
Hey,

Can I create a kind of reporting with ChronoConnectivity?



Example

I've got a database with some field (let's called it colA-colB-colC-colD).
[list]
  • ColA= Bird,Dog,Cat,Horse

  • ColB= date

  • ColC= House,Garden
  • [/list]

    My entries are as follow
    [list]
  • id - colA - colB - colD

  • 1 - cat - 01/01/2013 - house

  • 1 - dog - 01/01/2013 - house

  • 1 - cat - 01/01/2013 - house

  • 1 - cat - 01/02/2013 - garden

  • 1 - dog - 15/03/2013 - garden
  • [/list]

    And I would like to have some 'basic' reports:
    [list]
  • How many dogs lived in a house between 01/2013 - 03/2013: 35

  • How many dogs lived in a garden between 01/2013 - 03/2013: 18

  • How many cats lived in a house between 01/2013 - 03/2013: 15

  • How many cats lived in a garden between 01/2013 - 03/2013: 0 (should be filtered out?)
  • [/list]

    Any idea how i can achieve this?

    Thanks!
    GreyHead 26 Jun, 2013
    Hi brononius,

    ChronoConnectivity is really to do with lists of records. If you want to show the results of some custom queries then I'd probably do that using ChronoForms and a Custom Code action and Custom Element element.

    Bob
    brononius 26 Jun, 2013
    Ahh, ok...
    Over to Chronofrom then...😉


    I'm trying to put a filter by date-range.

    So i've created a form with 2 data fiels (date1 & date2). And the idea is that a person can select a range in here, and the result is given my this.

    In my 'DB Multi Record Loader', i've got in the WHERE statement
    inven_datumIN between "2013-01-01" AND "2013-03-01" 


    And this works like expected.
    But i want now replace the 2013-01-01 with the data of field date1 and 2013-03-01 with the data of field date2.

    Simply replacing the dates with the proper fieldnames doesn't do the trick. 😶
    Any suggestion?


    ps Maybe a moderator can move this post to chronoform subforum? :$
    brononius 26 Jun, 2013
    Okay,

    Found something. In my WHERE statement, i'm putting now:

    inven_datumIN between '<?php echo $form->data['Date1']; ?>' AND '<?php echo $form->data['Date2']; ?>' 
    



    And it works!
    Next step, some complex filter.😉
    brononius 26 Jun, 2013
    And the end result:

    
    inven_redenvan LIKE "
         <?php $form->data['redenvan_reden']; 
         if (empty($form->data['redenvan_reden'])) print "%";  
         else print "{$form->data['redenvan_reden']}"; ?>" 
    AND
    inven_bestemming LIKE "
         <?php $form->data['gevolg_reden']; 
         if (empty($form->data['gevolg_reden'])) print "%";  
         else print "{$form->data['gevolg_reden']}"; ?>" 
    AND
    inven_soort LIKE "
         <?php $form->data['Diersoort']; 
         if (empty($form->data['Diersoort'])) print "%";  
         else print "{$form->data['Diersoort']}"; ?>"
    AND
    `<?php echo $form->data['DatumInUit']; ?>` between '
         <?php echo $form->data['Datum1']; ?>' 
         AND '
         <?php echo $form->data['Datum2']; ?>' 


    This together with some predefined dropdown lists (out of the db) gives already a nice filter.
    Chronoform, nice tool, very nice tool...
    This topic is locked and no more replies can be posted.