KoolReport's Forum

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

PHP Fatal error: Call to a member function run() on null... #903

Open hsw opened this topic on on Jun 2, 2019 - 4 comments

hsw commented on Jun 2, 2019

Hi,

I was able to run a simple test report earlier, whereby the datasource is a csv file.

Then I tried to build another similar report. This time with a different csv file with more columns, and modified the class definitions accordingly.

I encountered this error when I tried to run the report: PHP Fatal error: Call to a member function run() on null in /xxxx/rpt/p1/index.php on line 5

What could be the likely cause?

Thank you

KoolReport commented on Jun 2, 2019

Could you please post your code of index.php

hsw commented on Jun 3, 2019

Here's my index.php:

<?php 

require_once "BasicCompare.php";
$basiccompare = new BasicCompare;
$basicompare->run()->render();

?>
KoolReport commented on Jun 3, 2019

You use wrong variable name, you create object with $basiccompare but use $basicompare (lack of a "c" character)

hsw commented on Jun 3, 2019

Oh I see. Thanks for pointing out.

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
solved

None