KoolReport's Forum

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

Call to undefined method CI_Loader::dataStore() #357

Open Babbandeep opened this topic on on Jul 10, 2018 - 1 comments

Babbandeep commented on Jul 10, 2018

In Codeigniter view file dataStore undefined error showing up

Controller

	public function get_payment_type_by_date($type = NULL)
    {				
				$report = new Payment(array(
				"dbname" => $this->dbname,
				"from"=>$this->input->post('from'),
				"to"=>$this->input->post('to'),
				'base_url' => base_url()
				));

				$report->run();

				$data = array(
					'report'=> $report
				);

				$this->load->view('index', $data);

}

view

    <?php 
      google\PieChart::create(array(
        "dataStore"=> $this->dataStore('payment'),
		"columns"=>array("type",
		"amount"=>array("prefix"=>"$")),
        "options"=>array(
          'title' => 'Payment By Type',
		  'pieSliceText'=>'value'
        ),
        "width"=>'100%',
        // 'height'=>'300px',
		"clientEvents"=>[
			"rowSelect"=>"function(params){
				window.location='<?php echo base_url(); ?>/reports/'+params.selectedRow[0];
			}"
		]
      ));
    ?>

ERROR

An uncaught Exception was encountered Type: Error

Message: Call to undefined method CI_Loader::dataStore()

KoolReport commented on Jul 10, 2018

Please do not confuse the view of koolreport's report and the view of the CodeIgniter. In the view or template of CodeIgniter, you call <?php $report->render(); ?>, the PieChart like above should be put in the view of your report (should be named Payment.view.php located in the same folder with Payment.php).

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

None