KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Implementation of Statistics #2137

Open Komuraiah A opened this topic on on Jun 9, 2021 - 6 comments

Komuraiah A commented on Jun 9, 2021

Dear Team, according to our project requirement I need to calculate some statistical data.So I'm implementing the statistical documentation code from packages .when I'm executing the code a blank page with no error is getting appear on the screen.so could you please help me.

<?php
//MyReport.php
require_once "vendor/koolreport/core/autoload.php";
require_once "vendor/koolreport_pro-5.0.4/examples/load.koolreport.php";

use \koolreport\statistics\Statistics;

class myreport extends \koolreport\KoolReport
{
	  public function settings()
    {
		
        return array(
            "dataSources"=>array(
                "". $_SESSION['c_db'] .""=>array(
                    "connectionString"=>"mysql:host=". $_SESSION['sqlHost'] .";dbname=". $_SESSION['c_db'] ."",
                    "username"=>$_SESSION['sqlUserName'],
                    "password"=>$_SESSION['sqlPassword'],
                    "charset"=>"utf8"
                ),
            )
        ); 
    }
    
    function setup()
    {
		
        $this->src('tblname')
		
        ->pipe(new Statistics(array(
		
            'min' => array('custEnquiryId'),
            'max' => array('custEnquiryId'),
       
        )))
        ->pipe($this->dataStore('result'));
    }
}
<?php
    //MyReport.view.php:
	 use \koolreport\widgets\koolphp\Table;
    use \koolreport\statistics\StatisticsReader;
 
    $stats = StatisticsReader::read($this->dataStore('result'));

    echo $stats['max']['custEnquiryId'];
	 echo $stats['min']['custEnquiryId'];
  
?>


Komuraiah A commented on Jun 10, 2021

Dear Team,please help me on above issue

Komuraiah A commented on Jun 10, 2021

Dear Team,I'm implementing the statistics code and executing code a blank page with no error getting appear on screen.so could you please help me

Komuraiah A commented on Jun 10, 2021

Dear Team, Please help me. I'm implementing the statistics code and when I executing the code a blank page with no error getting appear on screen.

Komuraiah A commented on Jun 10, 2021

Dear Team, according to our project requirement I need to calculate some statistical data.So I'm implementing the statistical documentation code from packages .when I'm executing the code a blank page with no error is getting appear on the screen.so could you please help me.

Komuraiah A commented on Jun 11, 2021

Dear Team,please help me on above issue

Sebastian Morales commented on Jun 14, 2021

In your report's view, pls print out the datastore's data and let us know the result:

    //MyReport.view.php
    print_r($this->dataStore('result')->data());

Rgds,

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Statistics